Hooking OnPlayerUpdate
#1

Simple: What's the most efficient way to hook OnPlayerUpdate? People have always said CallLocalFunction and/or CallRemoteFunction are slow.
Reply
#2

What about hooking a public function for a timer? Same method?
Reply
#3

Ah okay, this is very helpful, thanks. Just a bit annoying to have to 'define' the hooks though - not as easy as just 'Hook:' with y_hooks :/
Reply
#4

Hook: doesn't work with non-native callbacks though (such as a timer function), right? I tried that and it didn't work.

What about hooking it multiple times? In 3 different files?
Reply
#5

So if I wanted to 'chain' multiple callbacks, I'd add the ALS stuff at the bottom of the already-hooked one? But that'll be hard to maintain if I include a file between the two hooked ones?
Reply
#6

If they're called like this:

OnPlayerUpdate > MY_x > Your_x

If you remove MY_x, doesn't that mean Your_x will never be called? Because it's not being 're-directed' or whatever there? What if I have 100+ hooks and need to remove one in the middle?
Reply
#7

I see. ALS is pretty clever. Thanks.
Reply
#8

Quote:
Originally Posted by MP2
Посмотреть сообщение
OnPlayerUpdate > MY_x > Your_x
The real OnPlayerUpdate will be called last in most cases afaik, in some cases you need to consider that. Includes at the script top keep calling the next "OnPlayerUpdate", so as the real one usually comes below the includes of a gamemode it will be the last in row.
Reply
#9

Yeah, I just did some testing now to see what exactly what would happen.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)