Timer issue
#1

Hey Guys,
I have created a timer to basicly count to 25 seconds before it respawns the player.
The issue is that when this happens, the timer seems to decrease each time the player dies.
At top of the script I have:
pawn Код:
#define DEATH_TIME 25
new SecsToGo[MAX_PLAYERS];
new Death[MAX_PLAYERS char] = 0;
So OnPlayerDeath here is the code.

pawn Код:
SecsToGo[playerid] = DEATH_TIME;
DeathTimer{playerid} = SetTimerEx("Death", 1000, true, "i", playerid);
And then I have the timer.

pawn Код:
public Death(playerid)
{
    SecsToGo[playerid]--;
    if(SecsToGo[playerid] < 0)
    {
        SetAlive(playerid);
        return 1;
    }
    return 1;
}
Then I have the timer which sets the player alive.

pawn Код:
stock SetAlive(playerid)
{
    KillTimer(Death{playerid});
    return 1;
}
I have removed the variables, functions which are having no affect to the timer. Can someone please help me on this? And possibly shed some light to why its decreasing the time each time the player dies? If players die enough, they end up dying for like 1 second then respawning.
Reply


Messages In This Thread
Timer issue - by Deduction - 17.12.2013, 12:38
Re: Timer issue - by Patrick - 17.12.2013, 15:19

Forum Jump:


Users browsing this thread: 1 Guest(s)