Get Trailer ID
#1

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

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

Yes, but I'm talking about the specifics model of trailer
Reply
#4

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;
}
Reply
#5

Thanks It's work !
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)