Would it cause lagg?
#1

If i was using GetPlayerPos and saving the information to a variable under OnPlayerUpdate?

Thanks.
Reply
#2

possibly, why not just use a 1 second timer?
Reply
#3

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).
Reply
#4

Using Attach3dTextLabelToPlayer in OPU is not a good thing to do.
Reply
#5

Why would you need to get the player's position and re-attach it every player update? Once you attach it, it stays attached..
Reply
#6

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)
Reply
#7

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).
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)