SA-MP Forums Archive
How can I make a command for a certain vehicle only? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How can I make a command for a certain vehicle only? (/showthread.php?tid=154585)



How can I make a command for a certain vehicle only? - TheNuttyScientist - 14.06.2010

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?


Re: How can I make a command for a certain vehicle only? - NewTorran - 14.06.2010

NVM Misread


Re: How can I make a command for a certain vehicle only? - DJDhan - 14.06.2010

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
}



Re: How can I make a command for a certain vehicle only? - TheNuttyScientist - 14.06.2010

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.