13.04.2015, 11:50
If you want to actually learn what hooks are and how to use them, read the replies in a topic I made earlier: https://sampforum.blast.hk/showthread.php?tid=531197
y_hooks simplifies hooking, only needing you to do this:
A normal hook (ALS method 7) would look like this:
The only requirement is that you include y_hooks in every file you use hooks in, because y_hooks generates unique function names.
Source: http://ysi.wikia.com/wiki/Library:YSI%5Cy_hooks
It may not be up for long though as ****** left SA-MP today and binned all of his content.
EDIT: Please read what Southclaw wrote, as it covers a lot I didn't. I personally never used y_hooks so I can't give a lot of info.
y_hooks simplifies hooking, only needing you to do this:
pawn Код:
hook function(playerid)
{
// something
}
pawn Код:
public function(playerid)
{
#if defined something_function
return something_function(playerid);
#else
return true;
#endif
}
#if defined _ALS_function
#undef function
#else
#define _ALS_function
#endif
#define function something_function
#if defined something_function
forward something_function(playerid);
#endif
Source: http://ysi.wikia.com/wiki/Library:YSI%5Cy_hooks
It may not be up for long though as ****** left SA-MP today and binned all of his content.
EDIT: Please read what Southclaw wrote, as it covers a lot I didn't. I personally never used y_hooks so I can't give a lot of info.
Quote:
Originally Posted by Southclaw
Public functions and regular functions can be hooked and they require different methods. The two primary methods of hooking are: ALS and y_hooks (only works on publics).
|