[Ajuda] Errors no Gm ....
#1

Bom suspeito que alguem da minha casa mecheu no pawn quando eu editava um gm ... Tenho certeza que dizer vamos lar o gm esta com os seguintes errors que nao sei resolver :/


Primeiros errors
Код:
error 010: invalid function or declaration
 error 004: function "__OnDefaultParseFile" is not implemented
 error 001: expected token: "-identifier-", but found "forward"
 error 010: invalid function or declaration
 error 012: invalid function call, not a valid address
error 029: invalid expression, assumed zero
Linha dos errors

Код:
forward OnDefaultParseFile(extraid, value [], key [], tag [], file []);
public OnDefaultParseFile(extraid, value [], key [], tag [], file [])
{
 //	return printf("OnDefaultParseFile(%d, %s, %s, %s, %s)", extraid, value, key, tag, file);
	return 1;
}

Segundo error

Код:
: error 012: invalid function call, not a valid address
 : error 029: invalid expression, assumed zero
 : warning 215: expression has no effect
: error 001: expected token: ";", but found ")"
 : fatal error 107: too many error messages on one line

Linha do Erro

Код:
stock AdvanceSpectate(playerid)
{
    if(ConnectedPlayers() == 2) { StopSpectate(playerid); return 1; } // <<< error esta aqui
	if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && Player[playerid][gSpectateID] != INVALID_PLAYER_ID) {
            for(new x=Player[playerid][gSpectateID]+1; x<=MAX_PLAYERS; x++) {
                if(x == MAX_PLAYERS) { x = 0; }
                if(IsPlayerConnected(x) && x != playerid) {
                                if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && Player[x][gSpectateID] != INVALID_PLAYER_ID ||
                                        (GetPlayerState(x) != 1 && GetPlayerState(x) != 2 && GetPlayerState(x) != 3))
                                {
                                        continue;
                                }
                                else {
                                        StartSpectate(playerid, x);
                                        break;
                                }
                        }
                }
        }
 	return 1;
}
Reply
#2

Cara, vocк estб retornando 2 vezes em uma public..

pawn Код:
forward OnDefaultParseFile(extraid, value [], key [], tag [], file []);
public OnDefaultParseFile(extraid, value [], key [], tag [], file [])
{
    return printf("OnDefaultParseFile(%d, %s, %s, %s, %s)", extraid, value, key, tag, file);
}

A forward deverб estar em cima da public!.
Reply
#3

pode me explicar melhor
Reply
#4

No 1є erro como ja disseram vc esta utilizando 2 vezes o return fica assim:

pawn Код:
forward OnDefaultParseFile(extraid, value [], key [], tag [], file []);
public OnDefaultParseFile(extraid, value [], key [], tag [], file [])
{  
    return printf("OnDefaultParseFile(%d, %s, %s, %s, %s)", extraid, value, key, tag, file);   
}
e quanto ao segundo erro fica assim, acho;

pawn Код:
stock AdvanceSpectate(playerid)
{
    if(ConnectedPlayers == 2) { StopSpectate(playerid); return 1; }
    if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && Player[playerid][gSpectateID] != INVALID_PLAYER_ID) {
            for(new x=Player[playerid][gSpectateID]+1; x<=MAX_PLAYERS; x++) {
                if(x == MAX_PLAYERS) { x = 0; }
                if(IsPlayerConnected(x) && x != playerid) {
                                if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && Player[x][gSpectateID] != INVALID_PLAYER_ID ||
                                        (GetPlayerState(x) != 1 && GetPlayerState(x) != 2 && GetPlayerState(x) != 3))
                                {
                                        continue;
                                }
                                else {
                                        StartSpectate(playerid, x);
                                        break;
                                }
                        }
                }
        }
    return 1;
}
Reply
#5

Organiza seu cуdigo um pouquinho mais

pawn Код:
stock AdvanceSpectate(playerid)
{
    if(ConnectedPlayers == 2) { StopSpectate(playerid); return 1; }
    if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && Player[playerid][gSpectateID] != INVALID_PLAYER_ID) {
            for(new x=Player[playerid][gSpectateID]+1; x<=MAX_PLAYERS; x++) {
                if(x == MAX_PLAYERS) { x = 0; }
                if(IsPlayerConnected(x) && x != playerid) {
                                if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && Player[x][gSpectateID] != INVALID_PLAYER_ID ||
                                        (GetPlayerState(x) != 1 && GetPlayerState(x) != 2 && GetPlayerState(x) != 3)) continue;
                                        else
                                        StartSpectate(playerid, x); break;
                                }
                        }
                }
    return 1;

}
....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)