Would it cause lagg? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Would it cause lagg? (
/showthread.php?tid=190097)
Would it cause lagg? -
Whizion - 14.11.2010
If i was using GetPlayerPos and saving the information to a variable under OnPlayerUpdate?
Thanks.
Re: Would it cause lagg? -
cessil - 14.11.2010
possibly, why not just use a 1 second timer?
Re: Would it cause lagg? -
Whizion - 14.11.2010
Because i need to attach something to a player, and a 1 second would be to slow...
How does Attach3DTextLabelToPlayer not lagg? It to needs to get the player position somehow (and fast).
Re: Would it cause lagg? -
Retardedwolf - 14.11.2010
Using Attach3dTextLabelToPlayer in OPU is not a good thing to do.
Re: Would it cause lagg? -
Grim_ - 14.11.2010
Why would you need to get the player's position and re-attach it every player update? Once you attach it, it stays attached..
Re: Would it cause lagg? -
Simon - 14.11.2010
The topic poster never mentioned they were attaching a 3DText, they only enquired as to how Attach3DTextLabelToPlayer works.. possibly to use the technique with their own attachment code (however, that's not possible if it's done as I assume)
Quote:
Originally Posted by Whizion
Because i need to attach something to a player, and a 1 second would be to slow...
How does Attach3DTextLabelToPlayer not lagg? It to needs to get the player position somehow (and fast).
|
I've never seen the SA:MP source code, but it would make sense to assume Attach3DTextLabelToPlayer is probably just a function which signals some attachment code on the client. Once the client has been signalled to start the attaching process it will continue doing so until the server steps in and says equivalent to "no more attaching plz".
You should be fine to attach something to a player using this method, but if you want it 'perfect' then you may have a hard time achieving that due to lag (not necessarily caused by your script, but things like bad connections, pings). Your players shouldn't notice any lag generally, however that's not to say you should be lazy with optimising it (all the small things DO add up)
Re: Would it cause lagg? -
Whizion - 14.11.2010
Quote:
Originally Posted by Simon
The topic poster never mentioned they were attaching a 3DText, they only enquired as to how Attach3DTextLabelToPlayer works.. possibly to use the technique with their own attachment code (however, that's not possible if it's done as I assume)
I've never seen the SA:MP source code, but it would make sense to assume Attach3DTextLabelToPlayer is probably just a function which signals some attachment code on the client. Once the client has been signalled to start the attaching process it will continue doing so until the server steps in and says equivalent to "no more attaching plz".
You should be fine to attach something to a player using this method, but if you want it 'perfect' then you may have a hard time achieving that due to lag (not necessarily caused by your script, but things like bad connections, pings). Your players shouldn't notice any lag generally, however that's not to say you should be lazy with optimising it (all the small things DO add up)
|
Thanks for the explanation.
I wanted to attach the sound source to the player. (im using the audio plugin).