11.01.2015, 18:57
mHooks - Esay hooking callback and public functions!
mHooks simple system hooks do not have to use a dozen lines of code to do the Hook of one LINIK now!
How does it look? very simple
I already have the OnFilterScriptInit Hook
You wonder why hooks with * are HOOKS_CallHook in inc? so it would be easier for me when you update the plugin but I would have to update the plugin every edition - and so is every man for himself can add new callbacks, edit the parameters.
There is one thing we can easily add your own hooks public functions here's a small example:
Now we can use
Source:https://github.com/piatus/samp-hooks
Release:https://github.com/piatus/samp-hooks/releases
Sorry for my English.
mHooks simple system hooks do not have to use a dozen lines of code to do the Hook of one LINIK now!
How does it look? very simple
Код:
public OnFilterScriptInit()
{
printf("OnFilterScriptInit");
return 1;
}
HOOK:test.OnFilterScriptInit()
{
printf("test hook OnFilterScriptInit");
return 1;
}
Код:
needless public OnFilterScriptInit()
There is one thing we can easily add your own hooks public functions here's a small example:
Код:
forward OnPlayerLogin(playerid, bool:success);
public OnPlayerLogin(playerid, bool:success) HOOKS_CallHook("OnPlayerLogin", H_INT, playerid, H_BOOL, success);
#if defined _ALS_OnPlayerLogin
#undef OnPlayerLogin
#else
#define _ALS_OnPlayerLogin
#endif
#define OnPlayerLogin @@HOnPlayerLogin
forward @@HOnPlayerLogin(playerid);
Код:
public OnPlayerLogin(playerid, bool:success)
{
return 1;
}
HOOK:CHouses.OnPlayerLogin(playerid, bool:success)
{
return 1;
}
Release:https://github.com/piatus/samp-hooks/releases
Sorry for my English.


