SA-MP Forums Archive
Killing Timer Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Killing Timer Problem (/showthread.php?tid=593409)



Killing Timer Problem - Alpay0098 - 05.11.2015

Hi community,
I got this error in the following code (error 076: syntax error in the expression, or invalid function call)
Код:
KillTimer(ProgressBar);
Whole code : [ProgressBar function]
Код:
public ProgressBar()
{
    foreach(Player,playerid)
    {
		SetProgressBarValue(hungry[playerid], GetProgressBarValue(hungry[playerid])-10);
		UpdateProgressBar(hungry[playerid], playerid);
		if(GetProgressBarValue(hungry[playerid]) <= 0)
		{
	   		SetTimer("HungryTime", 10000, 1);
	   		SendClientMessage(playerid, COLOR_LIGHTBLUE, "Shoma alan gorosne hastid, lotfan ghaza bokhorid. agar nakhorid HP az dast midahid!");
            SetProgressBarValue(hungry[playerid], 0);
            KillTimer(ProgressBar); // Here's the problem
		}
	}
	return 1;
}
+Rep for best answer.


Re: Killing Timer Problem - Sh4d0w2 - 05.11.2015

Click Here


Re: Killing Timer Problem - jlalt - 05.11.2015

name your timer like:
PHP код:
new mytimer
set your timer:
PHP код:
mytimer SetTimer(....); 
then kill it by:
PHP код:
KillTimer(mytimer);