11.07.2018, 17:26
First you need to declare the trailers when you create them. For example:
Then check to see what trailer is by using something like this:
Use IsTrailerAttachedToVehicle to check if the vehicle has ANYTHING attached to it.
For example,
PHP код:
new TruckingTrailers[3];
TruckingTrailers[0] = CreateVehicle(/*vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren=0*/); //fruit trailer
PHP код:
if(GetVehicleTrailer(GetPlayerVehicleID(playerid)) == TruckingTrailers[0])
{
//trailer is fruit trailer
}
For example,
PHP код:
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)) != 1)
return print("no trailer"); //obviously you can change what happens if there is no trailer attached.