SA-MP Forums Archive
Trailers - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Trailers (/showthread.php?tid=351827)



Trailers - jop9888 - 17.06.2012

hee all,

i am busy making some baggage cars and trailers, and i saw that a baggacar can attach multiple baggage trailers!

is there anyway to let the script know how many trailers a baggage car is carrying?

because i need this in a mini-mission!

Thanks in advance!

Jop9888


Re: Trailers - Vince - 17.06.2012

I think something like this might work. Still untested.

pawn Код:
new trailer = GetVehicleTrailer(GetPlayerVehicleID(playerid));
new trailercount;

if(trailer)
{
    trailercount = 1;

    while((trailer = GetVehicleTrailer(trailer)))
    {
        trailercount++;
    }
}

printf("There are %d trailers.", trailercount);



Re: Trailers - jop9888 - 17.06.2012

i'm trying to test it, but for some reason the trailers after the first one i attach seem te respawn after about 30sec
i already tried changing the respawndelay but it doesn't affect it!

you got an idea how to prevent this?

EDIT: function aint working either, always says 1 trailer


Re: Trailers - SuperViper - 18.06.2012

This function will be in version 1.1 of svAddons which should be released very soon, you can find the include here:

https://sampforum.blast.hk/showthread.php?tid=348044


Re: Trailers - jop9888 - 18.06.2012

will keep an eye out for it, anyway you have an explanation for the respawning trailers?