If the vehicle health lower than 250, remove the player
#5

@Raweresh - Why not RemovePlayerFromVehicle?

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;
}
Should work^^ If the player is not removed from the vehicle and the debug is shown, please post below.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)