SA-MP Forums Archive
Quick Question on Timers - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Quick Question on Timers (/showthread.php?tid=238645)



Quick Question on Timers - Antonio [G-RP] - 12.03.2011

When you use SetTimerEx, it returns the ID of the timer created. Do the ID's of timers start at 0, or at 1?


Re: Quick Question on Timers - Kwarde - 12.03.2011

Why you don't try it with a fast gamemode?
pawn Код:
#include <a_samp>

new timer;

public OnGameModeInit()
{
    new playerid; //To prevent an error while compiling ;)
    timer = SetTimerEx("NonCallback", 5000, true, "i", playerid);
    printf("%d", timer);
    return 1;
}
My result (I forgot to put main() into it)

Код:
1
Script[gamemodes/KRPG.amx]: Runtime error 20: "Invalid index parameter (bad entry point)"
Number of vehicle mods: 0
So it is '1'


Re: Quick Question on Timers - Antonio [G-RP] - 12.03.2011

Alright, thank you.