SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 12/11/2011, 10:41 PM   #1
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,266
Reputation: 57
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, 123 views)
__________________
Filterscripts
Sgt's Driving License - Sgt's Debug - Sgt's RCON Addition - IpCheck - Advertisement
Includes
Sgt's Vehicle Functions
Functions
IsFloat

Trick to get faster and better help: Use (more or less) correct english and explain the problem detailed (and a "please" and "thank you" always helps).

check it out!

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

Damn, good job!
Add ToggleVehicleTrunk, Bonnet, Alarm, really useful, might use it one day.
__________________
Gigabyte GA-970A-D3
AMD FX-6300 3.5GHz 14MB AM3+
Zalman CNPS10X Cooler
Crucial 8,00GB (2x4GB) DDR3 PC3-10600 Ballistix Sport
XFX Radeon R9 270X 2GB GDDR5 256-bit 1000/5600
Western Digital Black 500GB 7200rpm 16MB SATA-III
Zalman Z9 Plus Black ATX
Zalman ZM500-LE 500W
GangsTa_ is offline   Reply With Quote
Old 12/11/2011, 10:51 PM   #3
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,266
Reputation: 57
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

Trick to get faster and better help: Use (more or less) correct english and explain the problem detailed (and a "please" and "thank you" always helps).

check it out!
Sascha is offline   Reply With Quote
Old 12/11/2011, 11:00 PM   #4
Norn
High-roller
 
Norn's Avatar
 
Join Date: Jul 2008
Location: Northern Ireland
Posts: 2,719
Reputation: 206
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!
__________________
Pursuing other endeavours.

Skype: datinvictusguy
Norn is offline   Reply With Quote
Old 12/11/2011, 11:02 PM   #5
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,266
Reputation: 57
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

Trick to get faster and better help: Use (more or less) correct english and explain the problem detailed (and a "please" and "thank you" always helps).

check it out!
Sascha is offline   Reply With Quote
Old 12/11/2011, 11:08 PM   #6
GangsTa_
High-roller
 
GangsTa_'s Avatar
 
Join Date: May 2010
Location: Republic of Moldova
Posts: 1,149
Reputation: 51
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.
__________________
Gigabyte GA-970A-D3
AMD FX-6300 3.5GHz 14MB AM3+
Zalman CNPS10X Cooler
Crucial 8,00GB (2x4GB) DDR3 PC3-10600 Ballistix Sport
XFX Radeon R9 270X 2GB GDDR5 256-bit 1000/5600
Western Digital Black 500GB 7200rpm 16MB SATA-III
Zalman Z9 Plus Black ATX
Zalman ZM500-LE 500W
GangsTa_ is offline   Reply With Quote
Old 13/11/2011, 07:10 AM   #7
System64
Gangsta
 
System64's Avatar
 
Join Date: May 2011
Location: Zadar, Croatia
Posts: 988
Reputation: 139
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, 12:43 PM   #8
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,266
Reputation: 57
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

Trick to get faster and better help: Use (more or less) correct english and explain the problem detailed (and a "please" and "thank you" always helps).

check it out!
Sascha is offline   Reply With Quote
Old 13/11/2011, 01:17 PM   #9
Michael@Belgium
High-roller
 
Michael@Belgium's Avatar
 
Join Date: Dec 2010
Location: Belgium
Posts: 2,494
Reputation: 833
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
Michael@Belgium is offline   Reply With Quote
Old 13/11/2011, 01:21 PM   #10
Mr_Scripter
Huge Clucker
 
Mr_Scripter's Avatar
 
Join Date: Mar 2011
Posts: 390
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 19 02/08/2013 10:58 AM
[Include] [INC] Vehicle functions v0.2.1 R2 kurta999 Includes 8 25/03/2011 06: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 11:22 AM


All times are GMT. The time now is 09:17 AM.


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