Problem with timers..
#2

Firstly, why do you have two timers with the same repeating interval? Makes no sense.
This is how a timer should look like:
pawn Код:
//somewhere in the gamemode, outside any other callback
forward MyFunction();
public MyFunction()
{
//code goes here
}

//usually under OnGameModeInit
SetTimer("MyFunction", 1000, 1);
This will make MyFunction repeat every 1 second. Now, all you have to do is write some code in the function and you're done. Of course, if you write the code wrongly, it will give unexpected results. Also you should take into account that SA:MP timers have a slight delay, which may get worse if you execute too many operations per second (see "AntiHackCheat" which is repeated 10 times per second).

This said, the rest of the code should be pretty easy to write, unless you're thinking at some sophisticated systems.
Reply


Messages In This Thread
Problem with timers.. - by dundolina - 12.04.2015, 00:02
Re: Problem with timers.. - by HazardouS - 12.04.2015, 08:24
Re: Problem with timers.. - by dundolina - 12.04.2015, 22:00
Re: Problem with timers.. - by Threshold - 12.04.2015, 22:07
Re: Problem with timers.. - by dundolina - 13.04.2015, 00:00
Re: Problem with timers.. - by Camorra - 13.04.2015, 08:53

Forum Jump:


Users browsing this thread: 1 Guest(s)