Timer Bug
#1

Hello I just created a question system and I want to make the question removing after 60 seconds so I created a timer

Код:
CMD:ask(playerid, params[])
{
    if(sscanf(params, "s[256]", Ask[playerid])) return SCM(playerid, -1, ""grey"Usage: "white"/ask [question]");
	if(AskInProgress[playerid] == true) return SCM(playerid, -1, ""red"[ERROR] "white"You have already an active question");
	
	new string[128];
	
	format(string, sizeof(string), ""orange"QUESTION from %s: "white"%s", pName(playerid), Ask[playerid]);
	SCMH(-1, string);
	
	AskInProgress[playerid] = true;
	SetTimer("deleteask", 5000, true);
	return 1;
}
then the callback

Код:
public:deleteask(playerid)
{
	if(AskInProgress[playerid] == true)
 	{
	    AskInProgress[playerid] = false;

	    SCM(playerid, -1, ""red"[INFO] "white"Your question has been automatically removed");
	    
	    SetTimer("deleteask", playerid, false);
	    
	}
    return 1;
}
I tested a lot of things but nothing worked
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: 1 Guest(s)