[Plugin] mHooks - Esay hooking callback and public functions!
#1

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
Код:
public OnFilterScriptInit()
{
	printf("OnFilterScriptInit");
	return 1;
}
 
HOOK:test.OnFilterScriptInit()
{
	printf("test hook OnFilterScriptInit");
	return 1;
}
I already have the OnFilterScriptInit Hook
Код:
 needless
public OnFilterScriptInit()
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:
Код:
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);
Now we can use


Код:
public OnPlayerLogin(playerid, bool:success)
{

return 1;
}


HOOK:CHouses.OnPlayerLogin(playerid, bool:success)
{
return 1;
}
Source:https://github.com/piatus/samp-hooks
Release:https://github.com/piatus/samp-hooks/releases

Sorry for my English.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)