Timer Problem (Y_Timers)
#1

pawn Code:
task GlobalTimer[1000]()
{
    new
        string[ 128]
    ;
    foreach(Player, i)
    {
        if(pCuffTime[i] >= 1)
        {
            pCuffTime[i] --;
            printf("%i", pCuffTime[i]);
        }
        else if(pCuffTime[i] == 1)
        {
            format(string, sizeof(string), "[SERVER]"COL_WHITE": %s(%d) Has been uncuffed by our System, reason: Anti Abuse", PlayerName(i), i);
            SendClientMessageToAll(COLOR_LIGHTYELLOW, string);
            TogglePlayerControllable(i, 1);
            IsPlayerCuffed[i] = false;
            pCuffTime[i] = 0;
            SetPlayerSpecialAction(i, SPECIAL_ACTION_NONE);
            print("[pCuffTime]: pCuffTime has been executed, the player has been released");
        }
    }
    return 1;
}
The timer counts down properly, but for some reason when the timer variable reaches to 1 it should release the player but it doesn't, I've debug alot of times as you can see on the code to check if my code is right. the debug shows perfect

Debug Information
pawn Code:
[16:24:56] 19
[16:24:58] 18
[16:24:59] 17
[16:25:00] 16
[16:25:01] 15
[16:25:02] 14
[16:25:03] 13
[16:25:04] 12
[16:25:06] 11
[16:25:07] 10
[16:25:08] 9
[16:25:09] 8
[16:25:10] 7
[16:25:11] 6
[16:25:12] 5
[16:25:13] 4
[16:25:14] 3
[16:25:16] 2
[16:25:17] 1
[16:25:18] 0
The code should work but it doesn't.
Reply


Messages In This Thread
Timer Problem (Y_Timers) - by Patrick - 03.10.2013, 15:30
Re: Timer Problem (Y_Timers) - by Dragonsaurus - 03.10.2013, 15:35
Re: Timer Problem (Y_Timers) - by Patrick - 03.10.2013, 15:42
Re: Timer Problem (Y_Timers) - by Jefff - 03.10.2013, 15:48

Forum Jump:


Users browsing this thread: 2 Guest(s)