SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 12/11/2011, 09:41 PM   #1
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,175
Reputation: 48
Default Sgt's Vehicle Functions

Sgt's Vehicle Functions Include

Hi guys,
This include contains some functions to control vehicles more easily. Some are "new" some are just re-called.

The current release is a beta stage and I would be happy about some suggestions for more functions (either re-names of old, or creation of new functions)!!

Version 0.6
Code:
 * GetVehicleModelByName(name[]);
 * IsValidVehicleModel(modelid);
 * VehicleExist(vehicleid); --> checks if a vehicle exists
Version 0.5
Code:
 * GetPlayerVehicleModel(playerid);
 * GetVehicleSpeed(vehicleid);
 * GetVehiclePlayers(vehicleid, player1, player2, player3, player4); --> DOES NOT RECOGNIZE PLAYERS IN SEATS HIGHER THAN ID 3
-----
0.5.1 - GetVehicleSpeed fixed
Version 0.4
Code:
 * Float:GetVehicleRot(vehicleid);
 - FreezeVehicle updated
Version 0.3
Code:
 * StopVehicle(vehicleid);
 * FreezeVehicle(vehicleid, freezstate); --> 1 = freezed & 0 = unfreezed
 * ToggleVehicleParams(vehicleid, params[], pstate) --> T_ENGINE, T_LIGHTS, T_ALARM, T_TRUNK, T_BONNET, T_OBJECTIVE
Version 0.2
Code:
 * ToggleVehicleTrunk(vehicleid, trunkstate); --> 0 = closed & 1 = open
 * ToggleVehicleBonnet(vehicleid, bonnetstate); --> 0 = closed & 1 = open
 * ToggleVehicleAlarm(vehicleid, alarmstate); --> 0 = off & 1 = on
 * ToggleVehicleObjective(vehicleid, objectivestate); --> 0 = off & 1 = on
Version 0.1
Code:
 * RespawnVehicle(vehicleid)
 * SetVehicleColor(vehicleid, color1, color2);
 * SetVehicleModel(vehicleid, newmodel);	--> Does only work for vehicles created with "CreateVehicle"
 * SetVehicleInterior(vehicleid, interiorid);
 * FlipVehicle(vehicleid);
 * SetVehicleRandomNumberPlate(vehicleid);
 * ExplodeVehicle(vehicleid);
 * ToggleVehicleEngine(vehicleid, enginestate); --> 0 = off & 1 = on
 * ToggleVehicleLight(vehicleid, lightstate); --> 0 = off & 1 = on
 * TeleportVehicle(vehicleid, Float:XCoord, Float:YCoord, Float:ZCoord, Float:Angle, Interiorid);
 * TeleportVehicleToPlayer(vehicleid, playerid);
 * Float:GetPlayerDistanceToVehicle(playerid, vehicleid);
 * GetPlayerNearestVehicle(playerid);
 * PutPlayerInNearestVehicle(playerid, seatid); --> same seatIDs as for PutPlayerInVehicle

Thanks and I hope you'll like it, although there aren't that much new functions yet.

External download: click here
Attached Files
File Type: rar sgtveh.rar (3.7 KB, 90 views)
__________________
Filterscripts
Sgt's Driving License - Sgt's Debug - Sgt's RCON Addition - IpCheck - Advertisement
Includes
Sgt's Vehicle Functions
Functions
IsFloat
Tutorials
Random Numberplate
Quote:
Originally Posted by Jay.
If I helped you in any of my posts, I would appreciate something. Not much just click
that little star near my profile
PILOT SERVER --- 91.121.154.28:8137

Last edited by Sascha; 14/12/2011 at 05:53 PM.
Sascha is offline   Reply With Quote
Old 12/11/2011, 09:44 PM   #2
GangsTa_
High-roller
 
GangsTa_'s Avatar
 
Join Date: May 2010
Location: Republic of Moldova
Posts: 1,159
Reputation: 50
Default Re: Sgt's Vehicle Functions

Damn, good job!
Add ToggleVehicleTrunk, Bonnet, Alarm, really useful, might use it one day.
GangsTa_ is offline   Reply With Quote
Old 12/11/2011, 09:51 PM   #3
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,175
Reputation: 48
Default Re: Sgt's Vehicle Functions

thanks for the suggestion, added those function and uploaded version 0.2
__________________
Filterscripts
Sgt's Driving License - Sgt's Debug - Sgt's RCON Addition - IpCheck - Advertisement
Includes
Sgt's Vehicle Functions
Functions
IsFloat
Tutorials
Random Numberplate
Quote:
Originally Posted by Jay.
If I helped you in any of my posts, I would appreciate something. Not much just click
that little star near my profile
PILOT SERVER --- 91.121.154.28:8137
Sascha is offline   Reply With Quote
Old 12/11/2011, 10:00 PM   #4
Norn
High-roller
 
Norn's Avatar
 
Join Date: Jul 2008
Location: Northern Ireland
Posts: 2,724
Reputation: 204
Default Re: Sgt's Vehicle Functions

Quote:
Originally Posted by Sascha View Post
thanks for the suggestion, added those function and uploaded version 0.2
Why not use one function instead of 4 and have a type param then define like TYPE_ALARM 1 etc?

Nice include!
__________________
SA-MP days are over.

Skype: datinvictusguy
Norn is offline   Reply With Quote
Old 12/11/2011, 10:02 PM   #5
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,175
Reputation: 48
Default Re: Sgt's Vehicle Functions

nice idea, norn, I'll add that, too for 0.3
__________________
Filterscripts
Sgt's Driving License - Sgt's Debug - Sgt's RCON Addition - IpCheck - Advertisement
Includes
Sgt's Vehicle Functions
Functions
IsFloat
Tutorials
Random Numberplate
Quote:
Originally Posted by Jay.
If I helped you in any of my posts, I would appreciate something. Not much just click
that little star near my profile
PILOT SERVER --- 91.121.154.28:8137
Sascha is offline   Reply With Quote
Old 12/11/2011, 10:08 PM   #6
GangsTa_
High-roller
 
GangsTa_'s Avatar
 
Join Date: May 2010
Location: Republic of Moldova
Posts: 1,159
Reputation: 50
Default Re: Sgt's Vehicle Functions

Quote:
Originally Posted by Sascha View Post
thanks for the suggestion, added those function and uploaded version 0.2
Looks cool.
GangsTa_ is offline   Reply With Quote
Old 13/11/2011, 06:10 AM   #7
System64
Gangsta
 
System64's Avatar
 
Join Date: May 2011
Location: Zadar, Croatia
Posts: 990
Reputation: 130
Default Re: Sgt's Vehicle Functions

wow, very nice and greate idea Keep it up man, rep+
__________________
All my works
I left SA:MP! Maybe once I start scripting again but now I'm based on web programming
Soon, I'll buy domain system32.com.hr but for now you can contact me on LogoOff or on my Youtube channel!
System64 is offline   Reply With Quote
Old 13/11/2011, 11:43 AM   #8
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,175
Reputation: 48
Default Re: Sgt's Vehicle Functions

updated to 0.3
more suggestions for functions are appreciated
__________________
Filterscripts
Sgt's Driving License - Sgt's Debug - Sgt's RCON Addition - IpCheck - Advertisement
Includes
Sgt's Vehicle Functions
Functions
IsFloat
Tutorials
Random Numberplate
Quote:
Originally Posted by Jay.
If I helped you in any of my posts, I would appreciate something. Not much just click
that little star near my profile
PILOT SERVER --- 91.121.154.28:8137
Sascha is offline   Reply With Quote
Old 13/11/2011, 12:17 PM   #9
Michael@Belgium
High-roller
 
Michael@Belgium's Avatar
 
Join Date: Dec 2010
Location: Belgium
Posts: 2,411
Reputation: 709
Default Re: Sgt's Vehicle Functions

God damn it Thanks for FreezeVehicle() !!!!

I tested it but it seem it has a problem with the timer, it freezes the vehicle less then a second then unfreeze (normal), then again freeze less then a second and unfreeze again ? You know what i mean
__________________
MY WORK | Currently rescripting my 1st server (PAT - test server) |
Scripting for money - PM me. | More info about exp-gaming | Watch me on twitch tv !

Quote:
A scripting language is a lightweight programming language.


Michael@Belgium is offline   Reply With Quote
Old 13/11/2011, 12:21 PM   #10
Mr_Scripter
Huge Clucker
 
Mr_Scripter's Avatar
 
Join Date: Mar 2011
Posts: 397
Reputation: 33
Default Re: Sgt's Vehicle Functions

nice work friend
__________________

Current Project: Stunt-DM-Drift-Race.
Done: 0%
Looking for 2Mappers... Pm Me

Gamemodes
SanAndreas Team DeathMatch Gamemode-4 hours work
Mr_Scripter is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Sgt's Driving License Sascha Filterscripts 16 16/11/2011 03:46 PM
[Include] [INC] Vehicle functions v0.2.1 R2 kurta999 Includes 8 25/03/2011 05:19 PM
[FilterScript] [FS] Vehicle Functions aircombat Filterscripts 19 25/08/2010 12:41 AM
[FilterScript] [FS] Vehicle Functions (Engine, Fuel, Car Names) Homerman Filterscripts 120 03/01/2010 10:22 AM


All times are GMT. The time now is 04:34 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.