Optimize this timers
#1

Hello guys,in OnGameModeInit i've this timers:

pawn Код:
zonetimer = SetTimer("ZoneUpdate", 2000, true);
    timer1 = SetTimer("AntiCheat",5000,true);
    SetTimer("SStats",10*60*1000,1);
   
    SetTimer("SendMSG", 60000, true);
Zonetimer is for gangwars system and runs every 2 seconds.
AntiCheat timer is obvious - Runs every 5 seconds.
SStats save all players stats every 10 minutes.
SendMsg is to send random messages on chat,runs every 60 seconds.

My question is,are they optimized or they run too fast and this will cause lag?Thanks.
Reply
#2

mhm.... i think the ZoneUpdater can be 5sec :P
but i dont know mutch about scripting
but i learing,! and i know that the ZoneUpdate dont Updateing himself all the time!
exemple: Download SATM Rp and check there / Or from other GangWar GM!
Reply
#3

Quote:
Originally Posted by James Coral
Посмотреть сообщение
mhm.... i think the ZoneUpdater can be 5sec :P
but i dont know mutch about scripting
but i learing,! and i know that the ZoneUpdate dont Updateing himself all the time!
exemple: Download SATM Rp and check there / Or from other GangWar GM!
I scripted from scratch the Anticheat and Gangwars system.I was asking this questions because i don't want have lag on the server.
Reply
#4

I have bout 10-12 timers in my stunt GM, and server, luckily, doesnt lags!
Reply
#5

So it will cause no lag?
Reply
#6

What you should try to do is desynchronize your timers so they don't activate simultaneously

Example:
TimerA is for every 2 seconds, TimerB is for every 5 seconds. 10 seconds in both timers will be activated at the same time ( TimerA on its fifth activation and TimerB on its second )

Also random messages every minute is too much, try every 15 minutes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)