Posts: 358
Threads: 38
Joined: May 2010
Reputation:
0
Hi, i have question about OnplayerUpdate callback
does OnPlayerUpdate strain a that player id or a server only or a both of them?
Posts: 966
Threads: 5
Joined: Jul 2011
Reputation:
0
What do you mean "strain"? If I think I understand you correctly, you're thinking of the callback having an impact on the server performance.
The callback is fired quite often for each player. I don't have exact statistics to back it up, but the more things that a player does, the more often this callback gets called. If you have 100 players online, you must keep in mind the code is ran approximately 2000 times a second or even more. This is why very extensive code and heavy calculations should not be ran here.
It can be helpful for a number of things: detect health changes, detect weapon changes and so on.
Posts: 3,002
Threads: 86
Joined: Jul 2010
Reputation:
0
sorry for bumping this, but I would like to use this callback to check if players are armed (no weapons server). Is this recommended or not? And if it is, how can I check them for weapons?
if you wanna make no weapons server simply dont use giveplayerweaponz ....
Posts: 3,002
Threads: 86
Joined: Jul 2010
Reputation:
0
Thank you.HuSs3n, I won't give weapons for sure, but some crapy people invented hacks for sa-mp.