25.01.2010, 14:19
You should use OnPlayerStateChange instead. As OnPlayerEnterVehicle is called when a player presses "ENTER". So you can't use RemovePlayerFromVehicle, becuase he's not sitting in the vehicle yet.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new veh = GetPlayerVehicleID(playerid);
if(veh == 497 || veh == 487 || veh == 563 || veh == 548)
{
if(GetPlayerScore(playerid) < 5)
{
RemovePlayerFromVehicle(playerid);
GameTextForPlayer(playerid, "~r~Removed from Vehicle - Score not high enough",4000,5);
SendClientMessage(playerid, COLOR_RED , "Kicked from vehicle - Score too low. Read /scoreinfo for help.");
return 1;
}
}
}
return 1;
}