18.10.2012, 19:12
Hooking CallBack(s) - How to Hook any callback
Hello all,
This tutorial is about hooking callback(s)-(any).
Let's start with simple example of OnFIlterScriptInit hook:
First we need to call the public that we want no hook:
Next we need to add this code to hook the callback:
And the last step, we need to forward the hook callbcack:
Now, when OnFilterScript will called the hook public wiil called to.
Enjoy!
Hello all,
This tutorial is about hooking callback(s)-(any).
Let's start with simple example of OnFIlterScriptInit hook:
Код:
public OnFilterScriptInit()
{
CallLocalFunction("RL@_OnFilterScriptInit", "");
//Your code here!
}
#if defined _ALS_OnFilterScriptInit
#undef OnFilterScriptInit
#else
#define _ALS_OnFilterScriptInit
#endif
#define OnFilterScriptInit RL@_OnFilterScriptInit
forward RL@_OnFilterScriptInit();
Код:
public OnFilterScriptInit()
{
}
Код:
#if defined _ALS_OnFilterScriptInit #undef OnFilterScriptInit #else #define _ALS_OnFilterScriptInit #endif #define OnFilterScriptInit PRE_OnFilterScriptInit
Код:
forward PRE_ OnFilterScriptInit();
Enjoy!

