Trailers
#6

First you need to declare the trailers when you create them. 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 
Then check to see what trailer is by using something like this:

PHP код:

if(GetVehicleTrailer(GetPlayerVehicleID(playerid)) == TruckingTrailers[0])
{
    
//trailer is fruit trailer

Use IsTrailerAttachedToVehicle to check if the vehicle has ANYTHING attached to it.

For example,

PHP код:

if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)) != 1)
    return print(
"no trailer"); //obviously you can change what happens if there is no trailer attached. 
Reply


Messages In This Thread
Trailers - by Skylt - 11.07.2018, 14:19
Re: Trailers - by Florin48 - 11.07.2018, 14:22
Re: Trailers - by Skylt - 11.07.2018, 14:31
Re: Trailers - by Florin48 - 11.07.2018, 14:34
Re: Trailers - by Skylt - 11.07.2018, 15:08
Re: Trailers - by ItsRobinson - 11.07.2018, 17:26
Re: Trailers - by Skylt - 11.07.2018, 19:04
Re: Trailers - by Sew_Sumi - 11.07.2018, 19:22
Re: Trailers - by Skylt - 11.07.2018, 19:29
Re: Trailers - by ItsRobinson - 11.07.2018, 19:59

Forum Jump:


Users browsing this thread: 2 Guest(s)