SA-MP Forums Archive
[Ajuda] Warning - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Warning (/showthread.php?tid=407302)



Warning - AlucardSnow - 13.01.2013

Esse Warnig, ja atualizei a include e nada!
Код:
\pawno\include\servermoneyGM.inc(84) : warning 201: redefinition of constant/macro (symbol "OnGameModeInit")
Linha:
pawn Код:
#define COLOR_WHITE              0xFFFFFFAA // Linha 84
// Tentei colocar
#define OnGameModeInit // Tentei arrumar, deu 26 ERROS
// Bom espero que possam ajudar =D



Re: Warning - Q.I - 13.01.2013

Quote:
Originally Posted by AlucardSnow
Посмотреть сообщение
Esse Warnig, ja atualizei a include e nada!
Код:
\pawno\include\servermoneyGM.inc(84) : warning 201: redefinition of constant/macro (symbol "OnGameModeInit")
Linha:
pawn Код:
#define COLOR_WHITE              0xFFFFFFAA // Linha 84
// Tentei colocar
#define OnGameModeInit // Tentei arrumar, deu 26 ERROS
// Bom espero que possam ajudar =D
mais й lуgico que darб warning || OnGameModeInit й uma public nгo tem necessidade de ter essa define ae , sу um burro faz uma coisa dessa ..


Re: Warning - AlucardSnow - 13.01.2013

Eu nao coloquei a warning...
Isso й SEM a Define ali


Re: Warning - zp42O - 13.01.2013

Me explique o porquк desta define:

Код:
#define OnGameModeInit // Tentei arrumar, deu 26 ERROS
oO


Re: Warning - HardWar - 13.01.2013

Retire a diretiva

pawn Код:
#define OnGameModeInit
Verifique se existe 2 callbacks OnGameModeInit em seu Gamemode. Se tiver sу uma, vб na include servermoneyGM, abra-a com o Notepad++ e procure por OnGameModeInit, delete essa callback.


Re: Warning - AlucardSnow - 13.01.2013

Olha a Include ae e me passa arrumada ?
pawn Код:
#define CallLoop(%1,%2) for(new %1; %1 < %2; %1++)
#define CALLBACK_AMOUNT 500

new SERVERSIDETIMER;
new ServerSideCash[MAX_PLAYERS];

public OnGameModeInit()
{
    ServerMoneyInit();
    return GMInit();
}

public OnGameModeExit()
{
    ServerMoneyExit();
    return GMExit();
}

forward GMInit();
forward GMExit();

ServerMoneyInit()
{
    SERVERSIDETIMER=SetTimer("ServerMoneyCB",1000,true);
    return 1;
}

ServerMoneyExit()
{
    KillTimer(SERVERSIDETIMER);
    return 1;
}


forward ServerMoneyCB();

public ServerMoneyCB()
{
    CallLoop(ServerSidep,MAX_PLAYERS)
    {
        if(IsPlayerConnected(ServerSidep))
        {
            if(GetPlayerMoney(ServerSidep) != ServerSideCash[ServerSidep])
            {
                new H4xc4sh=GetPlayerMoney(ServerSidep);
                H4xc4sh=H4xc4sh-ServerSideCash[ServerSidep];
                if(H4xc4sh > CALLBACK_AMOUNT) OnPlayerHaveExtraCash(ServerSidep,H4xc4sh);
            }
            GivePlayerMoney(ServerSidep,-GetPlayerMoney(ServerSidep));
            GivePlayerMoney(ServerSidep,ServerSideCash[ServerSidep]);
        }
       
    }
    return 1;
}


forward GivePlayerMoneyEx(playerid,cashgiven);
public GivePlayerMoneyEx(playerid,cashgiven)
{
    ServerSideCash[playerid]=ServerSideCash[playerid]+cashgiven;
    return 1;
}

forward ResetPlayerMoneyEx(playerid);
public ResetPlayerMoneyEx(playerid)
{
    ServerSideCash[playerid]=0;
    return 1;
}

forward GetPlayerMoneyEx(playerid);
public GetPlayerMoneyEx(playerid)
{
    return ServerSideCash[playerid];
}

forward OnPlayerHaveExtraCash(playerid,extraamount);

#define GetPlayerMoney GetPlayerMoneyEx
#define GivePlayerMoney GivePlayerMoneyEx
#define ResetPlayerMoney ResetPlayerMoneyEx

#define OnGameModeInit GMInit
#define OnGameModeExit GMExit



Re: Warning - HardWar - 13.01.2013

Retire as callbacks OnGameModeInit e OnGameModeExit da include e faзa o seguinte no seu GM:

pawn Код:
public OnGameModeInit()
{
    ServerMoneyInit();
    return 1;
}

public OnGameModeExit()
{
    ServerMoneyExit();
    return 1;
}
Acredito que assim funcionarб


Re: Warning - AlucardSnow - 13.01.2013

Essas Callbacks й
pawn Код:
#define OnGameModeInit GMInit
#define OnGameModeExit GMExit
?


Re: Warning - HardWar - 13.01.2013

CallBacks = Public