14.02.2012, 14:44
pawn Код:
timerid = SetTimer("Health", 1000, true); // this is in /god command
KillTimer(timerid); // in /godoff
forward Health(playerid);
public Health(playerid)
{
SetPlayerHealth(playerid, 100);
}
timerid = SetTimer("Health", 1000, true); // this is in /god command
KillTimer(timerid); // in /godoff
forward Health(playerid);
public Health(playerid)
{
SetPlayerHealth(playerid, 100);
}
timerid = SetTimer("Health", 1000, true); // this is in /god command
KillTimer("timerid"); // in /godoff
forward Health(playerid);
public Health(playerid)
{
SetPlayerHealth(playerid, 100);
}
timerid = SetTimer("Health", 1000, true); // this is in /god command
KillTimer(timerid); // in /godoff
forward Health(playerid);
public Health(playerid)
{
SetPlayerHealth(playerid, 100);
}
// 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;
}