How to make when car hp is lower than 20% to dont explode ?
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
[pawn]
Put that in a repeating global timer.
So do it like this:

pawn Код:
forward SomeTimer();
public SomeTimer()
{
    for(new i, vehicleid; i < MAX_PLAYERS; i++)
    {
        if((vehicleid = GetPlayerVehicleID(i))) // Note: we want this assignment, so one '=' only.
        {
            new Float:vhp;
            GetVehicleHealth(vehicleid, vhp);

            if(vhp < 250.0)
            {
                SetVehicleHealth(vehicleid, 250.0);
            }
        }
    }
}
Код:
SetTimer("SomeTimer", 1500, true);
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)