• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Hooks Problem
#1
Hi

I'm having a problem where a callback is not called in the modules (I'm using y_hooks). Using hooks with native callbacks this doesn't happen.



Code:
// GAMEMODE forward OnPlayerChangeJob(playerid, pJob); public OnPlayerChangeJob(playerid, pJob) { } OnPlayerChangeJob(playerid, pJob); // MODULES hook OnPlayerChangeJob(playerid, pJob) { ? ? SendClientMessage(playerid, -1, "CALLED!"); ? ? return true; }
  Reply
#2
How are you calling the custom callback? You need to use `CallLocalFunction` for hooks to work.
  Reply
#3
It's solved, thanks.



Sorry for that stupid question. I was putting 'OnPlayerChangeJob' on gamemode.
  Reply