Doing different things in same callback.
#2

Just hook the callback like in a normal include. In every .pwn file the OnPlayerDeath (for example) callback should look like this, if you actually use the callback, but if you don't use it in that module you don't need to use it at all:
pawn Код:
public OnPlayerDeath( playerid, killerid, reason )
{
    /*
                    CODES THERE
    */


    #if defined Module_OnPlayerDeath
        return Module_OnPlayerDeath( playerid, killerid, reason );
    #else
        return 1;
    #endif
}

#if defined _ALS_OnPlayerDeath
    #undef OnPlayerDeath
#else
    #define _ALS_OnPlayerDeath
#endif

#define OnPlayerDeath Module_OnPlayerDeath

#if defined Module_OnPlayerDeath
    forward Module_OnPlayerDeath( playerid, killerid, reason );
#endif
You should change the "Module_" prefix in every module you use, so it won't conflict.
Reply


Messages In This Thread
Doing different things in same callback. - by vassilis - 20.02.2016, 12:24
Re: Doing different things in same callback. - by IstuntmanI - 20.02.2016, 13:14

Forum Jump:


Users browsing this thread: 1 Guest(s)