y_hooks hook stops the original callback from executing - 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: y_hooks hook stops the original callback from executing (
/showthread.php?tid=551003)
y_hooks hook stops the original callback from executing -
CaveDweller - 16.12.2014
Hi guys. I've noticed that whilst the server calls my OnPlayerDisconnect hook in my include, it doesn't call my OnPlayerDisconnect callback in my main script.
Here is my include:
pawn Код:
#include <YSI\y_hooks>
hook OnPlayerDisconnect(playerid, reason) {
print("hook opd");
return 1;
}
and in my script:
pawn Код:
public OnPlayerDisconnect(playerid, reason) {
print("script opd");
return 1;
}
"hook opd" is printed, but not "script opd". If I remove the hook, "script opd" is printed.
Re: y_hooks hook stops the original callback from executing -
Stinged - 16.12.2014
Try removing "return 1;" from the hooked callback.
Re: y_hooks hook stops the original callback from executing -
CaveDweller - 16.12.2014
I tried that but it also didn't work. I also tried return -2 but that didn't work either.