Timer
#7

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;
}
Reply


Messages In This Thread
Timer - by emokidx - 14.02.2012, 14:44
Re: Timer - by Fires - 14.02.2012, 14:46
Re: Timer - by vakhtang - 14.02.2012, 14:47
Re: Timer - by emokidx - 14.02.2012, 14:48
Re: Timer - by vakhtang - 14.02.2012, 14:49
Re: Timer - by emokidx - 14.02.2012, 14:52
Re: Timer - by Universal - 14.02.2012, 15:30
Re: Timer - by sansko - 14.02.2012, 15:40
Re: Timer - by emokidx - 14.02.2012, 15:40

Forum Jump:


Users browsing this thread: 1 Guest(s)