26.11.2009, 22:46
Код:
at top of script: forward HealthOff(playerid);
so on player spawn we will set the timer:
Код:
SetTimerEx("HealthOff", 900*1000, 1,"i",playerid);
Код:
public HealthOff(playerid) { new Float:health; GetPlayerHealth(playerid, health); SetPlayerHealth(playerid, health -5.0); return 1; }
so at top of script:
Код:
new HealthTimer[MAX_PLAYERS]; //we will be saving the timer to an array so we know wich one to disable forward HealthOff(playerid);
Код:
HealthTimer[playerid] = SetTimerEx("HealthOff", 900*1000, 1,"i",playerid);
Код:
public HealthOff(playerid) { new Float:health; GetPlayerHealth(playerid, health); SetPlayerHealth(playerid, health -5.0); return 1; }
Код:
KillTimer(HealthTimer[playerid]);