SA-MP Forums Archive
Health Reducing. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Health Reducing. (/showthread.php?tid=475402)



Health Reducing. - Gogorakis - 12.11.2013

How can I make players losing 2% health every 1 minutes?


Re: Health Reducing. - Loot - 12.11.2013

pawn Код:
forward Timer();

public OnGameModeInit()
{
     SetTimer("Timer", 60000, true); // (1 minute interval)
     return 1;
}

public Timer()
{
     new Float: health;
     foreach(Player, i)
     {
          GetPlayerHealth(i, health); // get player health to make a change
          SetPlayerHealth(i, health - 2); // 2 is the percentage> 2%
     }
     return 1;
}