[Ajuda] ajuda com warning do capiroto...
#1

bom estou com um warning no gamemod e nao sei como arrumar essa inhaca '-' kkkk
bom quem puder me ajudar agradeзo

OBS: nao tem 2 OnGameModeInit no Gamemode ja verifiquei


warning:
PHP код:
C:\Users\igorm\Desktop\[GM]\pawno\include\servermoneyGM.inc(84) : warning 201redefinition of constant/macro (symbol "OnGameModeInit")
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
1 Warning

include:
PHP код:
#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_AMOUNTOnPlayerHaveExtraCash(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 
agradeзo deis de ja
Reply
#2

PHP код:
#include <a_samp>
#define CallLoop(%1,%2) for(new %1; %1 < %2; %1++)
#define CALLBACK_AMOUNT 500

forward GMInit();
forward GMExit();

new 
SERVERSIDETIMER;
new 
ServerSideCash[MAX_PLAYERS];

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

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

public 
GMInit()
{
    return 
1;
}

public 
GMExit()
{
    return 
1;
}

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_AMOUNTOnPlayerHaveExtraCash(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 
Reply
#3

PHP код:
C:\Users\igorm\Desktop\[GM]\pawno\include\servermoneyGM.inc(97) : warning 201redefinition of constant/macro (symbol "OnGameModeInit")
C:\Users\igorm\Desktop\[GM]\gamemodes\BPF.pwn(19173) : error 021symbol already defined"GMInit"
C:\Users\igorm\Desktop\[GM]\gamemodes\BPF.pwn(69215) : error 021symbol already defined"GMExit"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
2 Errors

agora deu isso
Reply
#4

Apaga isso:

Quote:

#define OnGameModeInit GMInit
#define OnGameModeExit GMExit

Reply
#5

agora deu isso:
PHP код:
C:\Users\igorm\Desktop\[GM]\gamemodes\BPF.pwn(19173) : error 021symbol already defined"Itter_OnGameModeInit"
C:\Users\igorm\Desktop\[GM]\gamemodes\BPF.pwn(69215) : error 021symbol already defined"OnGameModeExit"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
2 Errors

'-'
Reply
#6

PHP код:
#define CallLoop(%1,%2) for(new %1; %1 < %2; %1++) 
#define CALLBACK_AMOUNT 500 

new SERVERSIDETIMER
new 
ServerSideCash[MAX_PLAYERS]; 

public 
OnGameModeInit()
{
    
SERVERSIDETIMER SetTimer("ServerMoneyCB",1000,true); 
    
#if defined ServerMoneyInit
        
ServerMoneyInit();
    
#endif
    
return 1;
}
#if defined _ALS_OnGameModeInit
    #undef OnGameModeInit
#else
    #define _ALS_OnGameModeInit
#endif
#define OnGameModeInit ServerMoneyInit
#if defined ServerMoneyInit
    
forward ServerMoneyInit();
#endif

public OnGameModeExit()
{
    
KillTimer(SERVERSIDETIMER); 
    
#if defined ServerMoneyExit
        
ServerMoneyExit();
    
#endif
    
return 1;
}
#if defined _ALS_OnGameModeExit
    #undef OnGameModeExit
#else
    #define _ALS_OnGameModeExit
#endif
#define OnGameModeExit ServerMoneyExit
#if defined ServerMoneyExit
    
forward ServerMoneyExit();
#endif


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_AMOUNTOnPlayerHaveExtraCash(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 
Estuda mais sobre hooks

https://sampforum.blast.hk/showthread.php?tid=570910
Reply
#7

aee deu certo vlw aii mano

@EDIT

Nao deu certo nao.. compilo tudo certo mais o gamemode la mo samp ta: Unknowm

ajuda por favor
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)