SA-MP Forums Archive
GetVehicleModel - 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: GetVehicleModel (/showthread.php?tid=656539)



GetVehicleModel - TuNiSiAnO1 - 18.07.2018

Hello i have made this command to strat the job only if player in vehicle id 414 else it wont but even if i get in vehicle id 414 the job wont work and i get the "You need mule van to start this job" message whats wrong

PHP код:
CMD:clothes(playerid,params[])
{
  if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"You need Mule van to start this job");
  if(
GetVehicleModel(GetPlayerVehicleID(playerid) == 414))
  {
    
IsJob[playerid] = true;
    
BincoC CreateDynamicCP(2245.5964,-1660.4717,15.2866,3.0,-1,0,playerid,100.0,-1,0);
    
SendClientMessage(playerid,Roz,"{FFFFFF}Deliver the clothes to {FF0000}Binco {FFFFFF}store");
  }
  else
  {
    
SendClientMessage(playerid,Red,"You need Mule van to start this job");
  }
  return 
1;




Re: GetVehicleModel - iSpark - 18.07.2018

You placed the brackets wrong.

if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 414)


Re: GetVehicleModel - TuNiSiAnO1 - 18.07.2018

Quote:
Originally Posted by iSpark
Посмотреть сообщение
You placed the brackets wrong.

if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 414)
Thank you man


Re: GetVehicleModel - SlayerHodge - 18.07.2018

Код:
CMD:clothes(playerid,params[]) 
{ 
  if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"You need Mule van to start this job"); 
  if(GetVehicleModel(GetPlayerVehicleID(playerid) != 414)return   SendClientMessage(playerid,Red,"You need Mule van to start this job"); 
    IsJob[playerid] = true; 
    BincoC = CreateDynamicCP(2245.5964,-1660.4717,15.2866,3.0,-1,0,playerid,100.0,-1,0); 
    SendClientMessage(playerid,Roz,"{FFFFFF}Deliver the clothes to {FF0000}Binco {FFFFFF}store");  
}