How can I make a command for a certain vehicle only?
#1

I am creating a delivery script, and I only want to make the command to start them only available for a certain vehicle. How can I do this?
Reply
#2

NVM Misread
Reply
#3

Under OnPlayerCommandText(playerid,cmdtext[])

Код:
if(!strcmp(cmdtext,"/deliver",true,8))
{
  new veh=GetPlayerVehicleID(playerid);
  new mode=GetVehicleModel(veh);
  if(model!=420) return SendClientMessage(playerid,0xff00ffaa,"This command cannot be used in this vehicle"); //if the vehicle is not the vehicle you want the command to be used in

//rest of the code
  return 1
}
Reply
#4

Quote:
Originally Posted by Joe Torran C
Lock the vehicle for the player when they spawn,
And then when they type the command unlock it for that player,

Source:
https://sampwiki.blast.hk/wiki/SetVehicleParamsForPlayer
I think you misunderstood me there.

Anyway, cheers Dhan.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)