[Include] J4Rr3x's Vehicles Functions
#1

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

SetVehicleInterior is pretty much LinkVehicleToInterior, also RespawnVehicle is just SetVehicleToRespawn.
Reply
#3

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.
Reply
#4

I don't understand how it's more user friendly. You've just changed the name of the function.
Reply
#5

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.
Reply
#6

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

good job.
But it's more '' shorten '' There is something new.
Reply
#8

That might have made it easier for some scripters to manage vehicle functions. Good job mate.
Reply
#9

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

Quote:
Originally Posted by J4Rr3x
Посмотреть сообщение
Yes, i've define it to make them more user-friendly.
Some would say "confusing".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)