Question about 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: Question about y_hooks (
/showthread.php?tid=664299)
Question about y_hooks -
m1kas - 24.02.2019
Hello. I've been experimenting lately with y_hooks, and I was wondering if there is a way to stop other hooks from executing when the first one returns false? Okay, that might've sounded dumb, but let me explain it in another way;
1. First hook executes on OnVehicleSpawn. It checks if it is a valid vehicle (not spawned in by a client-side program). If it is spawned illegaly, it returns false, and in theory, this should stop any other hook from executing;
2. Second hook executes on OnVehicleSpawn, however it executes regardless of what the first hook returned.
3..-. All the other hooks execute as well, disregarding the first hook's return value.
My question is, is there a way to make it so if the first hook executed stops other hooks after it from executing? Thanks in advance.
Re: Question about y_hooks -
m1kas - 24.02.2019
Thank you very much, works perfectly!