SA-MP Forums Archive
[Include] Sgt's Vehicle Functions - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Sgt's Vehicle Functions (/showthread.php?tid=296760)



Sgt's Vehicle Functions - Sascha - 12.11.2011

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
Код:
 * GetVehicleModelByName(name[]);
 * IsValidVehicleModel(modelid);
 * VehicleExist(vehicleid); --> checks if a vehicle exists
Version 0.5
Код:
 * 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
Код:
 * Float:GetVehicleRot(vehicleid);
 - FreezeVehicle updated
Version 0.3
Код:
 * 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
Код:
 * 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
Код:
 * 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


Re: Sgt's Vehicle Functions - GangsTa_ - 12.11.2011

Damn, good job!
Add ToggleVehicleTrunk, Bonnet, Alarm, really useful, might use it one day.


Re: Sgt's Vehicle Functions - Sascha - 12.11.2011

thanks for the suggestion, added those function and uploaded version 0.2


Re: Sgt's Vehicle Functions - Norn - 12.11.2011

Quote:
Originally Posted by Sascha
Посмотреть сообщение
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!


Re: Sgt's Vehicle Functions - Sascha - 12.11.2011

nice idea, norn, I'll add that, too for 0.3


Re: Sgt's Vehicle Functions - GangsTa_ - 12.11.2011

Quote:
Originally Posted by Sascha
Посмотреть сообщение
thanks for the suggestion, added those function and uploaded version 0.2
Looks cool.


Re: Sgt's Vehicle Functions - System64 - 13.11.2011

wow, very nice and greate idea Keep it up man, rep+


Re: Sgt's Vehicle Functions - Sascha - 13.11.2011

updated to 0.3
more suggestions for functions are appreciated


Re: Sgt's Vehicle Functions - Michael@Belgium - 13.11.2011

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


Re: Sgt's Vehicle Functions - Sascha - 13.11.2011

Quote:
Originally Posted by Michael@Belgium
Посмотреть сообщение
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
mhm yea I know what you mean.. I'll try to fix it


EDIT: Should be fixed now.
(version 0.4 is uploaded)