J4Rr3x's Vehicles Functions -
J4Rr3x - 01.05.2015
J4Rr3x's Vehicles Functions
By J4Rr3x
Hi all, today i've made a some useful function for manage vehicles more easy. This is just first version, soon I'll update this include, if you have any ideas for new functions, please post them.
Natives:
pawn Код:
GetVehicleName(vehicleid)
GetVehicleModelName(modelid)
GetVehicleComponentName(componentid)
ToggleVehicleParams(vehicleid, params, bool: enable = true)
SetVehicleNumberPlateRandom(vehicleid)
FlipVehicle(playerid)
SetVehicleInterior(vehicleid, interiorid)
SetVehicleColor(vehicleid, color1, color2)
RespawnVehicle(vehicleid)
IsPlayerDriver(playerid)
IsVehicleOccupied(vehicleid)
GetNearestVehicle(playerid)
GetVehicleDriver(vehicleid)
Enum:
pawn Код:
enum {
VEHICLE_PARAMS_TYPE_ALL,
VEHICLE_PARAMS_TYPE_ENGINE,
VEHICLE_PARAMS_TYPE_LIGHTS,
VEHICLE_PARAMS_TYPE_ALARM,
VEHICLE_PARAMS_TYPE_DOORS,
VEHICLE_PARAMS_TYPE_BONNET,
VEHICLE_PARAMS_TYPE_TRUNK,
VEHICLE_PARAMS_TYPE_OBJECTIVE,
VEHICLE_PARAMS_TYPE_SIREN
}
Changelog:
Код:
05/10/2015:
- Some fix in code
- Added IsValidVehicle if isn't already defined in gamemode
- Added GetNearestVehicle(playerid)
- Added GetVehicleDriver(vehicleid)
05/05/2015: (<- Thanks to ziggi)
- Less memory for SetVehicleNumberPlateRandom
- Added VEHICLE_PARAMS_TYPE_ALL
- Add GetVehicleModelName
- Checks for GetVehicleComponentName
- Added IsVehicleOccupied
05/01/2015:
- Made this include
Downloads:
BitBucket Page
Re: J4Rr3x's Vehicles Functions -
Luis- - 01.05.2015
SetVehicleInterior is pretty much LinkVehicleToInterior, also RespawnVehicle is just SetVehicleToRespawn.
Re: J4Rr3x's Vehicles Functions -
J4Rr3x - 01.05.2015
Quote:
Originally Posted by Luis-
SetVehicleInterior is pretty much LinkVehicleToInterior, also RespawnVehicle is just SetVehicleToRespawn.
|
Yes, i've define it to make them more user-friendly.
Re: J4Rr3x's Vehicles Functions -
Luis- - 01.05.2015
I don't understand how it's more user friendly. You've just changed the name of the function.
Re: J4Rr3x's Vehicles Functions -
ihatetn931 - 02.05.2015
Quote:
Originally Posted by Luis-
I don't understand how it's more user friendly. You've just changed the name of the function.
|
SetVehicleInterior is much easier to remeber then LinkVehicleToInterior.
Re: J4Rr3x's Vehicles Functions -
Richie© - 03.05.2015
The functions are very generic, i have all theese things covered in my gm plus alot more.
But this might be good for new scripters. Try to add unique stuff in your inc like this guy did
http://forum.sa-mp.com/showthread.ph...hlight=Vehicle
Coming up with unique stuff at this point might be tough though, since alot has already been done.
Re: J4Rr3x's Vehicles Functions -
LorDWarS - 03.05.2015
good job.
But it's more '' shorten '' There is something new.
Re: J4Rr3x's Vehicles Functions -
TittyMcSwag - 03.05.2015
That might have made it easier for some scripters to manage vehicle functions. Good job mate.
Re: J4Rr3x's Vehicles Functions -
J4Rr3x - 03.05.2015
Quote:
Originally Posted by Richie©
The functions are very generic, i have all theese things covered in my gm plus alot more.
But this might be good for new scripters. Try to add unique stuff in your inc like this guy did http://forum.sa-mp.com/showthread.ph...hlight=Vehicle
Coming up with unique stuff at this point might be tough though, since alot has already been done.
|
Quote:
Originally Posted by LorDWarS
good job.
But it's more '' shorten '' There is something new.
|
Quote:
Originally Posted by TittyMcSwag
That might have made it easier for some scripters to manage vehicle functions. Good job mate.
|
Thanks very much!
I'll extend this
Re: J4Rr3x's Vehicles Functions -
Patrik356b - 05.05.2015
Quote:
Originally Posted by J4Rr3x
Yes, i've define it to make them more user-friendly.
|
Some would say "confusing".