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



Admin Vehicle? - _Sami_ - 27.12.2009

(Admin Vehicle = hunter hydra etc) I want that any admin creates any vehicle in the server so the normal player wasnt able to enter in it . Can Any One Help me .

pawn Код:
#define hunter  425
#define rhino  432
#define hydra  520
#define cargobob 548

//-----------------------------------------------------------------

public OnGameModeInit()
{
AddStaticVehicleEx(425,2262.4951,2060.3794,10.8338,178.9972,75,2,180); // hunter
AddStaticVehicleEx(432,2275.3401,2059.5378,10.8291,182.8891,75,2,180); // rhino
AddStaticVehicleEx(548,2287.6721,2060.2100,10.8243,179.2161,75,2,180); // cargobob
AddStaticVehicleEx(520,2300.1016,2060.4719,10.8101,177.8003,75,2,180); // hydra
    return 1;
}
//-----------------------------------------------------------------
public OnPlayerStateChange(playerid, newstate, oldstate)
{
 if(newstate == PLAYER_STATE_DRIVER)
  {
 
   if(AdminVehicle(vehicle))
   {
     if(!IsPlayerAdmin(playerid))
     {
      RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, COLOR_BRIGHTRED, "This Vehicle is only for Admins!");
     }
   }
  }
  return 1;
}
//----------------------------------------------------------------------
AdminVehicle(vehicleid){
  new model = GetVehicleModel(vehicleid);
  switch(model){
  case hydra, hunter, rhino, cargobob: return 1;
  default: return 0;
    }

  return 0;
}
The problem is it doesnt shows the message + doesnt remove player from vehicle


Re: Admin Vehicle? - _Sami_ - 27.12.2009

no one ?


Re: Admin Vehicle? - Mariachi - 27.12.2009

Try this, test it, I'm not sure.

Код:
new AdminVehicles[4];

Under OnGameModeInIt

AdminVehicles[0] = 425;
AdminVehicles[1] = 432;
AdminVehicles[2] = 548;
AdminVehicles[3] = 520;

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER)
	{
		if(!IsPlayerAdmin(playerid))
		{
	    new carid = GetPlayerVehicleID(playerid);
	    for(new i=0; i<4; i++)
  	  {
    	  if( carid == Vehs[i] )
      	{
		      RemovePlayerFromVehicle(playerid);
		      SendClientMessage(playerid, COLOR_BRIGHTRED, "This Vehicle is only for Admins!");
      	}
			}
		}
	}
	return 1;
}



Re: Admin Vehicle? - _Sami_ - 27.12.2009

its also not working .