SA-MP Forums Archive
Check a function every 2 seconds - 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: Check a function every 2 seconds (/showthread.php?tid=495854)



Check a function every 2 seconds - Necip - 19.02.2014

So I made a function to check ammo, but I don't know where to put it. I tried under OnPlayerUpdate but it doesn't work. What shall I do? Shall I make a timer? If yes, how?

Thanks.


Re: Check a function every 2 seconds - itsCody - 19.02.2014

pawn Код:
public OnGameModeInIt()
{
    SetTimer("funcname", 2000, 1);
    return 1;
}

forward funcname();
public funcname()
{
    // stuff here
    return 1;
}



Re: Check a function every 2 seconds - Necip - 19.02.2014

Nvm solved alraedy thanks anyways.