14.02.2012, 15:30
pawn Код:
// Change timerid variable into array
// Find the new timerid; and change it into this:
new timerid[MAX_PLAYERS];
// Its SetTimerEx not SetTimer!
timerid[playerid] = SetTimerEx("Health", 1000, true, "d", playerid);
// In /godoff
KillTimer(timerid[playerid]);
// This'll be called each second
forward Health(playerid);
public Health(playerid)
{
// Checking if player's connected
if(!IsPlayerConnected(playerid))
KillTimer(timerid[playerid]);
else
SetPlayerHealth(playerid, 100.0);
return 1;
}