[HELP] Ranks connected to cars?
#5

It's Very simple. Try this:

pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    new carid;
    carid = GetVehicleModel(GetPlayerVehicleID(playerid));
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        if(IsCopCar(carid) && PlayerInfo[playerid][pRank] >= 1) // If Player Enters any Cop Car and is Ranked 1 or less
        {
            SendClientMessage(playerid, 0xFF0000AA, "You cannot use this Vehicle, You need to be above Level 1 - Ejected");
            RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}
You'll need to also add Andre's IsCopCar function as well:

pawn Код:
stock IsCopCar(carid)
{
  new Operative[] = { 523, 427, 490, 528, 596, 597, 598, 599 };
  for(new i = 0; i < sizeof(Operative); i++)
  {
    if(GetVehicleModel(carid) == Operative[i]) return 1;
  }
  return 0;
}
Untested.

EDIT: It will stop anyone who enters a cop car and is ranked 1 or less to be ejected. This is not what you want looking at ur original post. I used the variable you gave only for the player ranks. If you want just add/ change the rank to check if the player's not a cop.
Reply


Messages In This Thread
[HELP] Ranks connected to cars? - by FreddeN - 19.07.2009, 17:00
Re: [HELP] Ranks connected to cars? - by FreddeN - 19.07.2009, 17:04
Re: [HELP] Ranks connected to cars? - by ByFukara - 19.07.2009, 17:05
Re: [HELP] Ranks connected to cars? - by FreddeN - 19.07.2009, 17:07
Re: [HELP] Ranks connected to cars? - by member - 19.07.2009, 17:08
Re: [HELP] Ranks connected to cars? - by FreddeN - 19.07.2009, 17:18
Re: [HELP] Ranks connected to cars? - by member - 19.07.2009, 17:20
Re: [HELP] Ranks connected to cars? - by FreddeN - 19.07.2009, 17:26
Re: [HELP] Ranks connected to cars? - by member - 19.07.2009, 17:34

Forum Jump:


Users browsing this thread: 1 Guest(s)