SA-MP Forums Archive
How to use this on one type of vehicle - 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 to use this on one type of vehicle (/showthread.php?tid=211361)



How to use this on one type of vehicle - Jacob_T_Harden - 15.01.2011

How can I transform this instead of just one Ambulance, It does it for every one spawned ever?


Код:
new ambulance;
ambulance = AddStaticVehicle(cords...)
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{   
      if(newstate == PLAYER_STATE_DRIVER)    
         {        
            new veh = GetPlayerVehicleID(playerid);        
            new pskin=GetPlayerSkin(playerid);        
            if(pskin != 275 || pskin != 276 && veh == ambulance)           
               {                
           RemovePlayerFromVehicle(playerid);                
        SendClientMessage(playerid, 0x00FF00AA, "This vehicle is only for Medics!");                
     return 1;            
   }        
return 1;   
 }



Re: How to use this on one type of vehicle - GangsTa_ - 15.01.2011

Add more variables and continue coding.


Re: How to use this on one type of vehicle - Jacob_T_Harden - 15.01.2011

Thats what I dont want to do.. I was told I could do it once, And it would do it for every ambulance


Re: How to use this on one type of vehicle - PeteShag - 15.01.2011

pawn Код:
public IsAnAmbulance(car)
{
  new model = GetVehicleModel(car);
  if(model == 416 || model == 407 || model == 544) return true;
  return false;
}



Re: How to use this on one type of vehicle - Jacob_T_Harden - 15.01.2011

@pete
Thanks alot, But where do I input this into the script for it to function properly? Its late, But Ive put it everywhere.. I cant get it.