10.03.2013, 07:22
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate==PLAYER_STATE_DRIVER || newstate==PLAYER_STATE_PASSENGER)
{
if(GetVehicleIModel(GetPlayerVehicleID(playerid))==425 && GetPlayerScore(playerid)<1500) || (GetVehicleModel(GetPlayerVehicleID(playerid))==432 && GetPlayerScore(playerid)<500)
{
RemovePlayerFromVehicle(playerid); //allready is like slapping the player!
PlayerPlaySound(playerid, 1130);
SendClientMessage(playerid, COLOR_GREEN, "Your score is less for this vehicle");
}
}
return 1;
}
You need to use OnPlayerStateChange because OnPlayerEnterVehicle only gets called when the player enters the vehicle with "F" or "Enter", so he isn't in the vehicle which means you can't remove him.