[Include] Sgt's Vehicle Functions
#1

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
Reply
#2

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

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

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!
Reply
#5

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

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

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

updated to 0.3
more suggestions for functions are appreciated
Reply
#9

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
Reply
#10

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)