Include filterscript problem
#5

No, the link i gave is what i meant. Read it and you will understand.

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
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:
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
Reply


Messages In This Thread
Include filterscript problem - by Sh4d0w2 - 06.11.2015, 01:31
Re: Include filterscript problem - by Gammix - 06.11.2015, 01:33
Re: Include filterscript problem - by Sh4d0w2 - 06.11.2015, 01:38
Re: Include filterscript problem - by Sh4d0w2 - 06.11.2015, 01:54
Re: Include filterscript problem - by Gammix - 06.11.2015, 03:12

Forum Jump:


Users browsing this thread: 2 Guest(s)