SA-MP Forums Archive
Timer... invalid function "UpdateServerStats()" - 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: Timer... invalid function "UpdateServerStats()" (/showthread.php?tid=571065)



Timer... invalid function "UpdateServerStats()" - d3ll - 15.04.2015

Declaring

Код:
new UpdateServerStatsTimer;
Код:
forward UpdateServerStats();
Structure (function)

Код:
public UpdateServerStats() // Every 1 second
{
	return 1;
}
Calling

Код:
UpdateServerStatsTimer = SetTimerEx("UpdateSetverStats", 1000, true, "");
Error

Код:
[21:36:33] (TimerFix) ERROR: Invalid function ("UpdateSetverStats").



Re: Timer... invalid function "UpdateServerStats()" - Crayder - 15.04.2015

UpdateServerStatsTimer = SetTimerEx("UpdateServerStats", 1000, true, "");

You had a 't' instead of 'r'.


Re: Timer... invalid function "UpdateServerStats()" - _GHT_MarK445 - 15.04.2015

Well. In SetTimerEx you need to write the correct name of the function for what are you using it.

Name of your function used by timer is different, than name of the timer, check for that, you did a little mistake in that name.


Re: Timer... invalid function "UpdateServerStats()" - d3ll - 15.04.2015

Today isn't a good day :@


Re: Timer... invalid function "UpdateServerStats()" - Konstantinos - 15.04.2015

Use SetTimer instead of SetTimerEx since you never pass any argument to it though.


Re: Timer... invalid function "UpdateServerStats()" - d3ll - 15.04.2015

Done, thanks for the tip Konstantinos.