The return value of a function with y_hooks - 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)
+--- Thread: The return value of a function with y_hooks (
/showthread.php?tid=578730)
The return value of a function with y_hooks -
Dutheil - 21.06.2015
Hi I want to know, how can I get the return value of a function with y_hooks.
By default, I would for OnPlayerUpdate, but I did that :
PHP код:
afk = hook OnPlayerUpdate(i);
printf("%d", afk);
It shows me 1, even when I'm back Windows.
Any idea ?
Re: The return value of a function with y_hooks -
IstuntmanI - 21.06.2015
OnPlayerUpdate always returns 1 (or the value you specified in callback). When the player is AFK that callback is not called at all (so it isn't returning 0 or 1). You are just basically calling a normal function.
Re : The return value of a function with y_hooks -
Dutheil - 21.06.2015
Ah yes, shit.
I have done differently and it works, thank you anyway.