15.07.2011, 22:08
And some little corrections to Jefff's code
Also I think that the regeneration should stop at full health
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;
}