y_hooks
#1

I have a problem hooking custom functions, native callbacks hook perfectly without problems. I have the latest YSI version and I can't figure out why I can't hook functions.

This is the code:
pawn Код:
#include        YSI_Coding\y_hooks
 
public OnFilterScriptInit()
{
    Function();
    print("\n--Base FS loaded.\n");
    return 1;
}
 
forward Function();
public Function()
{
    print("public");
}
 
hook Function()
{
    print("Hook");
}
 
// Prints just "public"
This is kind of urgent, since I can't find another way to hook functions in my modular gamemode. Thanks
Reply
#2

You have to call the function via CallLocalFunction:
pawn Код:
//No more direct
Function();
//Now
CallLocalFunction("Function", "");
//Or if you are including y_als
call Function();
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)