How to use public functions in an include??
#8

You will need to use the next OnPlayerConnect after the first one + it's definitions.

Also, you're only supposed to use the callback ONCE, the #define thingies are there to not generate errors the next time the CB gets called. And make sure the code gets reached ofc.

pawn Код:
public OnPlayerConnect(playerid)
{
    if(funcidx("F_OnPlayerConnect") != -1)
    {
        return CallLocalFunction("F_OnPlayerConnect", "i", playerid);
    }
    return 1;
}
   
#if defined _ALS_OnPlayerConnect
    #undef OnPlayerConnect
#else
    #define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect F_OnPlayerConnect
forward F_OnPlayerConnect(playerid);

//In a different script (Or at least not the include)

public OnPlayerConnect(playerid)
{
    //code
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)