how to repeat a timer 15times
#7

And some little corrections to Jefff's code

Also I think that the regeneration should stop at full health

pawn Код:
forward Regeneration(playerid, times);
public Regeneration(playerid, times)
{
    if(0 < times)
    {
        new Float: Health;
        if(GetPlayerHealth(playerid, Health))
        {
            if(100.0 < (Health += 2.0)) SetPlayerHealth(playerid, 100.0);
            else
            {
                SetPlayerHealth(playerid, Health);
                SetTimerEx("Regeneration", 2000, false, "dd", playerid, times - 1);
            }
            return true;
        }
    }
    return false;
}
Reply


Messages In This Thread
how to repeat a timer 15times - by MWhite_005 - 15.07.2011, 17:43
Re: how to repeat a timer 15times - by Tigerkiller - 15.07.2011, 17:46
Re: how to repeat a timer 15times - by MWhite_005 - 15.07.2011, 18:01
Re: how to repeat a timer 15times - by Seven_of_Nine - 15.07.2011, 19:09
Re: how to repeat a timer 15times - by Roko_foko - 15.07.2011, 19:13
Re: how to repeat a timer 15times - by Jefff - 15.07.2011, 19:14
AW: Re: how to repeat a timer 15times - by Nero_3D - 15.07.2011, 22:08
Re: how to repeat a timer 15times - by MWhite_005 - 15.07.2011, 22:19
Re: how to repeat a timer 15times - by MWhite_005 - 15.07.2011, 22:27
Re: how to repeat a timer 15times - by Adil - 15.07.2011, 22:31

Forum Jump:


Users browsing this thread: 7 Guest(s)