05.03.2009, 09:09
This should help you, I've made it so no player can enter as driver or passenger, if you want to change that just remove the "|| newstate == PLAYER_STATE_PASSENGER" part.
Place it under public OnPlayerStateChange(playerid,newstate,oldstate)
If you place it under OnPlayerEnterVehicle it will only be called when the player pressed ENTER, at that time they aren't yet in the vehicle, so they can't be ejected from it.
pawn Код:
new plvehid;
plvehid = GetVehicleModel(GetPlayerVehicleID(playerid));
new skin = GetPlayerSkin(playerid);
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
if(plvehid == 597)
{
if( (skin == 287) || (skin == 163) || (skin == 282) || (skin == 255) || (skin == 165))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "== You can use this vehicle to do your job.");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "== You are not a cop.");
RemovePlayerFromVehicle(playerid);
}
}
}
If you place it under OnPlayerEnterVehicle it will only be called when the player pressed ENTER, at that time they aren't yet in the vehicle, so they can't be ejected from it.