Hooking OnPlayerUpdate -
MP2 - 01.02.2013
Simple: What's the most efficient way to hook OnPlayerUpdate? People have always said CallLocalFunction and/or CallRemoteFunction are slow.
Re: Hooking OnPlayerUpdate -
MP2 - 01.02.2013
What about hooking a public function for a timer? Same method?
Re: Hooking OnPlayerUpdate -
MP2 - 01.02.2013
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 :/
Re: Hooking OnPlayerUpdate -
MP2 - 01.02.2013
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?
Re: Hooking OnPlayerUpdate -
MP2 - 01.02.2013
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?
Re: Hooking OnPlayerUpdate -
MP2 - 01.02.2013
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?
Re: Hooking OnPlayerUpdate -
MP2 - 02.02.2013
I see. ALS is pretty clever. Thanks.
Re: Hooking OnPlayerUpdate -
Mauzen - 02.02.2013
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.
Re: Hooking OnPlayerUpdate -
MP2 - 02.02.2013
Yeah, I just did some testing now to see what exactly what would happen.