Timer Bug
#3

Quote:
Originally Posted by dusk
Посмотреть сообщение
You don't pass the player id to deleteask. Do you think it will just magically appear?

If you want to pass arguments to a timer function, use SetTimerEx.

pawn Код:
SetTimerEx("deleteask", 5000, false, "i", playerid);

forward deleteask(playerid);
public deleteask(playerid)
{
    if(AskInProgress[playerid] == true)
    {
        AskInProgress[playerid] = false;

        SCM(playerid, -1, ""red"[INFO] "white"Your question has been automatically removed");
    }
    return 1;
}

Also, the 2nd parameter of SetTimer/SetTimerEx is if the timer should be repeated. If set to true, the function will be called EVERY 5 seconds untill you use KillTimer.
I used

Код:
KillTimer(deleteask(playerid));
and it was repeating, btw SetTimerEx is just for one time and SetTimer for repeating?
Reply


Messages In This Thread
Timer Bug - by SecretBoss - 08.07.2015, 14:29
Re: Timer Bug - by dusk - 08.07.2015, 14:36
Re: Timer Bug - by SecretBoss - 08.07.2015, 14:39
Re: Timer Bug - by dusk - 08.07.2015, 14:43
Re: Timer Bug - by SecretBoss - 08.07.2015, 14:48

Forum Jump:


Users browsing this thread: 2 Guest(s)