Hooking OnPlayerConnect
#1

Hey there. I tried to add something to be called under OnPlayerConnect in test include file, and I get some errors and warnings in my gamemode when I include the file. This is my code:
pawn Код:
#if defined _ALS_OnPlayerConnect
    #undef OnPlayerConnect
#else
    #define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect MyLib_OnPlayerConnect

public OnPlayerConnect(playerid)
{
    #if defined MyLib_OnPlayerConnect
        MyLib_OnPlayerConnect(playerid);
    #endif
    OldPos[playerid][0] = 0.0;
    OldPos[playerid][1] = 0.0;
    OldPos[playerid][2] = 0.0;
    return 1;
}


#if defined MyLib_OnPlayerConnect
    forward MyLib_OnPlayerConnect();
#endif
I got this errors and warnings:
Код:
warning 201: redefinition of constant/macro (symbol "OnGameModeInit")
error 021: symbol already defined: "OnPlayerConnect"
error 021: symbol already defined: "OnPlayerConnect"
error 017: undefined symbol "OnPlayerConnect"
error 010: invalid function or declaration
Can someone tell me why this hooking doesn't work?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)