Timer Question - 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 Question (
/showthread.php?tid=374921)
Timer Question -
Marusa - 04.09.2012
Hi.. I need advice about timer... I have made my anticheat system and I need to use a timer.. I have few global timer, one of these timers are return every 500 ms and in this function I have call foreach and SetTimerEx for each player to check something ... I need advice is there slow my server and if this way is not the best, can you present me better ...
Sry for bad english, I hope that you understand me... I don't have experience with timer and player... I have make a perfect anticheat but I am Thinking Twice about that...
I want to max optimitize server!
Thanks in advance
Re: Timer Question -
Nova_ - 04.09.2012
What can of anticheat for weapon anticheat i'd use OnPlayerKeyStateChange when they fire that forbidden they get banned.
Re: Timer Question -
Kitten - 04.09.2012
Nova's theory is pretty easy and simple without any timers.
If you'd like to do it with timers follow these steps,
1.Create a callback
2.Set a specific timer on that callback
3.Have all the anticheat stuff weapon hacks, health hack etc (make sure the timer is atleast 2000ms)
Done instead of creating bunch of callbacks.
Re: Timer Question -
Marusa - 04.09.2012
I have in one callback - Airbreak, Fly hack, Teleport, Weapon ... and some check about area(prison) ...
It works perfect if few players on server, but I don't know is this complicated when I have more and more players ...
sry for bad eng..
Re: Timer Question -
Marusa - 05.09.2012
Yap... Is there any way to simulate players ?
Re: Timer Question -
Marusa - 05.09.2012
I know that take more time, that is my problem. I don't know what will happen when I have more and more players.. thats loops are going to be longer(take more time) ... I don't know what to do :/ How to check that..