09.04.2013, 11:33
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
Regards: D
if( GetVehicleModel( GetVehicleTrailer( your_vehicleid ) ) ) { return SendClientMessage( playerid, -1, "First attach a trailer model 591 !" ); }
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;
}