Get Trailer ID - 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: Get Trailer ID (
/showthread.php?tid=429351)
Get Trailer ID -
KopeK - 09.04.2013
Hi. I have a question. I have a command and I want to do it that the command did not work when the vehicle does not have a trailer attached with id 591 How to do it?
Regards: D
Re: Get Trailer ID -
IstuntmanI - 09.04.2013
https://sampwiki.blast.hk/wiki/GetVehicleTrailer
Код:
if( GetVehicleModel( GetVehicleTrailer( your_vehicleid ) ) )
{
return SendClientMessage( playerid, -1, "First attach a trailer model 591 !" );
}
EDIT: I forgot the != 591 part. >.>
Re: Get Trailer ID -
KopeK - 09.04.2013
Yes, but I'm talking about the specifics model of trailer
Re: Get Trailer ID -
[XST]O_x - 09.04.2013
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/command"))
{
if( GetVehicleModel( GetVehicleTrailer( GetPlayerVehicleID(playerid) ) ) == 591)
{
//Command stuff
}
else return SendClientMessage(playerid, -1, "ERROR: You must attach a 591-type trailer to your vehicle first!");
return 1;
}
return 0;
}
Re: Get Trailer ID -
KopeK - 09.04.2013
Thanks
It's work !