29.01.2011, 04:23
how can i decrease player health with a timer ?(not instant kill ex: -5 or -3)
#include <a_samp>
#define SECONDS 60
forward HealthDecrease(playerid);
public OnGameModeInit()
{
SetTimer("HealthDecrease", SECONDS*1000, true);
return 1;
}
public HealthDecrease(playerid)
{
new Float:HP;
GetPlayerHealth(playerid, HP);
SetPlayerHealth(playerid, HP-1);
return 1;
}
pawn Код:
|
Your code doesn't work, you've to use a loop inside the callback because "(playerid)" will be always 0.
|
Originally Posted by Grdamn13
if u are using a gf edit just /sethp
|