Timer or OPU
#1

Hey guys,

What should i use to avoid players from getting any weapons through hacks, a timer or OnPlayerUpdate?
I think a timer would be better, since it doesnt gets called like 30+ (rough guess) in a second

What do you guys think?

~Wesley
Reply
#2

Timer
Reply
#3

OnPlayerUpdate was made for use of an efficient anti-cheat. Just don't put things under there which will take forever to process.
Reply
#4

So if i would add 'if( PlayerInfo[playerid][pAdmin] < 3 ) ResetPlayerWeapons(playerid);', then it wouldnt lagg the server that much; right?
Reply
#5

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
So if i would add 'if( PlayerInfo[playerid][pAdmin] < 3 ) ResetPlayerWeapons(playerid);', then it wouldnt lagg the server that much; right?
It won't lagg so much that it's unplayable :P
Reply
#6

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
So if i would add 'if( PlayerInfo[playerid][pAdmin] < 3 ) ResetPlayerWeapons(playerid);', then it wouldnt lagg the server that much; right?
It takes about 100 ms to do a 1 million loop of something like that. I think you will be fine doing that on OnPlayerUpdate.
Reply
#7

I use schedule code under my OPU, for example make it so certain code only gets called every second, or each 20 updates. That way you still use OPU and the server doesen't have to process another timer.
Reply
#8

Alright, thanks all
Edit:
Quote:
Originally Posted by playbox12
Посмотреть сообщение
I use schedule code under my OPU, for example make it so certain code only gets called every second, or each 20 updates. That way you still use OPU and the server doesen't have to process another timer.
Can u explain that a lil more?
Reply
#9

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Alright, thanks all
Edit:


Can u explain that a lil more?
Use a variable that updates every time OPU is called. Check to see if that variable has reached (i.e.) 20, this means OPU has been called 20 times. If it has, then reset the variable and perform what you wanted to. This process will keep happening, in an attempt to stop most lag.
Reply
#10

Thats actually pretty useful, never thought of that
Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)