Car entering block by skin number
#1

How could I make system: People who got example LVPD Officer Skin, Can only enter police vehicles?
Reply
#2

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER)
    {
      new vehid = GetVehicleModel(GetPlayerVehicleID(playerid));
      if(vehid == /*Put the police vehicle shit here*/)
      {
        if(GetPlayerSkin(playerid) == /*Put the skin number here*/)
        {
            RemovePlayerFromVehicle(playerid);
            }
        }
    }
    return 1;
}
guess this is it
Reply
#3

this is my simple idea...
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(GetPlayerSkin(playerid) != 1 && GetVehicleModel(vehicleid) == 1) //Change id's. If the player isn't cop, he will be removed from vehicle
    RemovePlayerFromVehicle(playerid);
  }
  return 1;
}
Reply
#4

Thank you
Reply
#5

OnPlayerEnterVehicle would be the best callback to use, as it changes when the player presses F. OnPlayerStateChange only changes to Player_state_driver when the player is fully in the car and ready to go..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)