Posts: 434
Threads: 80
Joined: Oct 2008
Reputation:
0
Hi all, i got an suggest for the onplayerupdate callback.
Ad extrat param.
OnPlayerUpdate(playerid,case,extrat[])
Case: Weapon Update, Pos Update
Extrat: Get AK47, was to 156.2,25.2,13.3 and move to 70.2,170.2,13.3
Thank You
Max
Posts: 2,698
Threads: 37
Joined: Mar 2012
Reputation:
0
GetPlayerWeapon can be used for such cases and it isn't needed.
OnPlayerUpdate is a callback and under that we can use many functions.
The weapon thing you said are all there, have a look on Wiki samp.
Btw, suggestions can be posted on thread "Suggestions for future SA-MP."
Posts: 7
Threads: 0
Joined: Nov 2011
Reputation:
0
OnPlayerUpdate will be called roughly 20-50 times per second per player, depending on your streaming rate settings, and any processing done in there will visibly stop the server from being able to proceed new synchronization (try adding a really long look in there). Creating such a string for each of these updates that will very rarely be used, because the amount of data being written down there is much too extensive to output, is just unnecessarily overhead.
If the server keeps track of which fields of a player's state were modified during the last sync packet, a function such as GetPlayerLastUpdateData() could be added... The same question remains though: why would you want this? What is your use-case?