06.11.2015, 03:12
No, the link i gave is what i meant. Read it and you will understand.
You need to hook the callback (OnPlayerConnect), like this:
Note, MyLib should not coincide with other hooked callbacks. You can name your hook to anything (e.g.: MyLib_OPC)
Also, You can leave one callback without hooking it. Because thats the original purpose of hooking.
Here is what you have to do:
In your file #include "../filterscripts/map.pwn"
Check where OnPlayerConnect is and hook it like this:
You need to hook the callback (OnPlayerConnect), like this:
pawn Код:
public OnPlayerConnect(playerid)
{
#if defined MyLib_OnPlayerConnect
MyLib_OnPlayerConnect(playerid);
#endif
return 1;
}
#if defined _ALS_OnPlayerConnect
#undef OnPlayerConnect
#else
#define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect MyLib_OnPlayerConnect
#if defined MyLib_OnPlayerConnect
forward MyLib_OnPlayerConnect(playerid);
#endif
Also, You can leave one callback without hooking it. Because thats the original purpose of hooking.
Here is what you have to do:
In your file #include "../filterscripts/map.pwn"
Check where OnPlayerConnect is and hook it like this:
pawn Код:
public OnPlayerConnect(playerid)
{
//your code here
#if defined MyLib_OnPlayerConnect
MyLib_OnPlayerConnect(playerid);
#endif
return 1;
}
#if defined _ALS_OnPlayerConnect
#undef OnPlayerConnect
#else
#define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect MyLib_OnPlayerConnect
#if defined MyLib_OnPlayerConnect
forward MyLib_OnPlayerConnect(playerid);
#endif