24.02.2014, 07:48
Quote:
The damage values were off the top of my head and are meant to be edited. As for the hooking, would you suggest another method of doing so, as it works fine.
|
pawn Код:
public OnPlayerConnect(playerid)
{
//codes.
#if defined LIBNAME_OnPlayerConnect
return LIBNAME_OnPlayerConnect(playerid); //This is being done to get this include compatible with the scripts using it. So in case if those scripts too use the same callback, it would call it.
#else
return 1;
#endif
}
#if defined _ALS_OnPlayerConnect
#undef OnPlayerConnect
#else
#define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect LIBNAME_OnPlayerConnect
#if defined LIBNAME_OnPlayerConnect
forward LIBNAME_OnPlayerConnect(playerid);
#endif
This hook method being used is some what called "Hook method 7" and you can get the tutorial of it explained well from the below link. I'm also adding the old hooking method's tutorial which would probably fix your confusion about hooking process.
https://sampforum.blast.hk/showthread.php?tid=441293 - Hook method 7
https://sampforum.blast.hk/showthread.php?tid=392061 - Normal hooking.