29.11.2014, 10:38
@Raweresh - Why not RemovePlayerFromVehicle?
Should work^^ If the player is not removed from the vehicle and the debug is shown, please post below.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new Float:health;
GetVehicleHealth(GetPlayerVehicleID(playerid), health);
if(health < 300.0)
{
printf("DEBUG: Removed player %d from vehicle due to low health", playerid); //For debug purposes (optional)
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}