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

<----
Reply
#2

Read this one, next time use search.
https://sampforum.blast.hk/showthread.php?tid=245249
Reply
#3

This is not what i am searching
Reply
#4

pawn Код:
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);
        }
    }
}
Put that in a repeating global timer.
Reply
#5

Where to put ?
Reply
#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
#7

Where must i start this time
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)