if SetVehicleHealth?
#7

Alright. Then you need a timer to put at OnGameModeInit/OnFilterScriptInit (Depending on if you use a GM or FS).
pawn Код:
SetTimer("CheckHealth", 1000, 1); //Timer which gets called every second
And then you have to add at the bottom of your GM/FS:
pawn Код:
forward CheckHealth();
public CheckHealth()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerInAnyVehicle(i) && GetPlayerSkin(i) != 50)
        {
            new Float:health;
            GetVehicleHealth(GetPlayerVehicleID(i), health));
            if(health < 400.0)
            {
                RemovePlayerFromVehicle(i);
                SendClientMessage(i, COLOR_BLUE, "[Vehicle] You were removed from your vehicle because it had less than 400 health points.");
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
if SetVehicleHealth? - by Gooday - 08.04.2012, 11:16
Re: if SetVehicleHealth? - by Jeffry - 08.04.2012, 11:18
Re: if SetVehicleHealth? - by Gooday - 08.04.2012, 11:19
Re: if SetVehicleHealth? - by Jeffry - 08.04.2012, 11:20
Re: if SetVehicleHealth? - by Reklez - 08.04.2012, 11:21
Re: if SetVehicleHealth? - by Gooday - 08.04.2012, 11:27
Re: if SetVehicleHealth? - by Jeffry - 08.04.2012, 11:30

Forum Jump:


Users browsing this thread: 1 Guest(s)