Fixes2
#1

Hi, I wanted to know if someone could explain me, how to use fixes2, cause I use SetTimer, and I wanted it to be more accurate.
But I dont understood how to use fixes2. Do I just have to download the plugin, set it and that's all ?
Or do I have to do something more to get more accurate timers with SetTimer ?



Thank you !



Source: https://sampforum.blast.hk/showthread.php?tid=375925
Reply
#2

UP

No one know please ?
Reply
#3

to use it download the plugin
and paste this in at top of your script
pawn Code:
native SetTimer_(const func[], const delay, const interval, const count);
native SetTimerEx_(const func[], const delay, const interval, const count, const format[], {Float, _}:...);
native KillTimer_(timer) = KillTimer;
and use "SetTimer_" and "SetTimerEx_" instead of "SetTimer and "SetTimerEx"
the usage of them is pretty well explained in the topic
Reply
#4

I though that those native were here for an other usage. But if it's exactly the same than SetTimer, thank you


EDIT:

If I got this for exemple:
"SetTimer("SauvegardeJoueurs", 60000 * TEMPS_ENTRE_SAUVEGARDE_JOUEUR, true);"

How will it be with this plugin ? Thank you
Reply
#5

like this
SetTimer_("SauvegardeJoueurs", 0, 60000 * TEMPS_ENTRE_SAUVEGARDE_JOUEUR, - 1);"
Reply
#6

Thank you !

I will try if it works IG.

+rep
Reply
#7

Sorry for the double post,


I actually have a problem, so I did this: "SetTimer_("SauvegardeJoueurs", 0, 60000 * TEMPS_ENTRE_SAUVEGARDE_JOUEUR, -1);"


And then in my SauvegardeJoueurs function I added a SendClientMessageToAll, to see IG when the timer starts.

So normally I should get a message every minute, but now I got sometime one message, sometimes 2 or 3 per min.


Code:
public SauvegardeJoueurs()
{
	SendClientMessageToAll(-1, "Save");
	foreach(new i : Player)
	{
		if(Connecte[i] == 1)
		{
			SauvegardeJoueur(i);
		}
	}
}
Do anyone know where's my problem ?

Thank you.
Reply
#8

Show us where you defined TEMPS_ENTRE_SAUVEGARDE_JOUEUR, that is what you are multiplying what the minute should be... 1 minute = 60000 ms, TEMPS_ENTRE_SAUVEGARDE_JOUEUR = ?...?
Reply
#9

TEMPS_ENTRE_SAUVEGARDE_JOUEUR = 1 So it should be a minute.



As you can see the message is repeated 2 times or 3 times in a minute sometimes.
Reply
#10

Is the timer set multiple times for some reason?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)