Issue with Cars
#3

This is pretty easy. When you create a vehicle, it returns the vehicle's id. You need to fetch the id and store it in a variable. Then, when a player enters the plane and is not a pilot or w/e, it needs to remove them. Or you can lock the plane's doors ( players can still get in the plane if someone leaves the doors open ).

pawn Код:
//Create a variable for the planes ( adjust the size of the variable for however many needed )
new Planes[4];

//Find when the vehicle is created
Planes[0] = AddStaticVehicle/CreateVehicle//...
Planes[1] = //The same
//Etc...

//Create this callback if not already there
public OnPlayerStateChange(playerid,newstate,oldstate)
{
  if(newstate == PLAYER_STATE_DRIVER)
  {
     if(GetPlayerVehicleID(playerid) == Planes[1])
     {
       if(//Use some variable to check if they are able to use these ( admin, etc.. ))
       {
          RemovePlayerFromVehicle(playerid);
          return 1;
       }
     }
     //Do the same for the other planes.
  }
  return 1;
}
Try that.
Reply


Messages In This Thread
Issue with Cars - by zappydude - 11.02.2009, 23:22
Re: Issue with Cars - by zappydude - 12.02.2009, 00:28
Re: Issue with Cars - by Backwardsman97 - 12.02.2009, 00:37
Re: Issue with Cars - by zappydude - 12.02.2009, 16:25

Forum Jump:


Users browsing this thread: 1 Guest(s)