[Ajuda] Erros no sistema de pedagio
#1

Olб amigos, eu peguei este sistema de outra GM, copiei tudo certinho, sу que estб dando alguns erros.

Erros:
error 017: undefined symbol "aTolls"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Cуdigo completo:
Код:
forward TollUpdate();
public TollUpdate() // Needs to be called in the OnPlayerUpdate function
{
	for(new i = 0; i < MAX_TOLLS; i++)
	{
		if(aTolls[i][E_tOpenTime] > 0); // linha dos erros //
		{
			aTolls[i][E_tOpenTime]--;
			if(aTolls[i][E_tOpenTime] == 1)
			{
				Toll_CloseToll(i);
			}
		}
	}
}
Espero que me ajudem, obrigado!
Reply
#2

Tente:

Tinha um ; no final do if.

pawn Код:
forward TollUpdate();
public TollUpdate() // Needs to be called in the OnPlayerUpdate function
{
    for(new i = 0; i < MAX_TOLLS; i++)
    {
        if(aTolls[i][E_tOpenTime] > 0) // linha dos erros //
        {
            aTolls[i][E_tOpenTime]--;
            if(aTolls[i][E_tOpenTime] == 1)
            {
                Toll_CloseToll(i);
            }
        }
    }
}
Reply
#3

Nгo compilou, ainda continua com os mesmos erros, eu tinha colocado o ';' ali pra testar, mais nгo compilou tambem.
Reply
#4

pawn Код:
new aTolls[MAX_PLAYERS]; //topo
Acho que faltou isso
Reply
#5

Agora deu esses erros:

error 001: expected token: ")", but found "["
error 029: invalid expression, assumed zero
error 017: undefined symbol "E_tOpenTime"
fatal error 107: too many error messages on one line

Код:
if(aTolls[i][E_tOpenTime] > 0) // linha dos erros //
Reply
#6

pawn Код:
new E_tOpenTime; // topo
Reply
#7

Substitua seu TOLL_INFO por este:

pawn Код:
enum TOLL_INFO
{
    E_tLocked,  // 0 & 1 = Richhman, 2 & 3 = Flint, 4 & 5 = LV, 6 & 7 = BlueBerry right
    E_tOpenTime // 0 & 1 = Richhman, 2 & 3 = Flint, 4 & 5 = LV, 6 & 7 = BlueBerry right
}
Reply
#8

Quote:
Originally Posted by willttoonn
Посмотреть сообщение
Substitua seu TOLL_INFO por este:

pawn Код:
enum TOLL_INFO
{
    E_tLocked,  // 0 & 1 = Richhman, 2 & 3 = Flint, 4 & 5 = LV, 6 & 7 = BlueBerry right
    E_tOpenTime // 0 & 1 = Richhman, 2 & 3 = Flint, 4 & 5 = LV, 6 & 7 = BlueBerry right
}
Agora deu isso:

warning 215: expression has no effect
error 001: expected token: ";", but found "["
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

Код:
aTolls[RichmanToll][E_tOpenTime] = 7; // LINHA DOS ERROS //
Reply
#9

pawn Код:
new aTolls[MAX_PLAYERS][TOLL_INFO]; // coloque no topo e apague essa > new aTolls[MAX_PLAYERS];
Reply
#10

Deu vбrios erros, resolvi alguns, ficou 2 sem resolver por quк nгo conseguir resolver, e tambйm lotou de warning.

Erros e Warning:

Код:
Erro: error 017: undefined symbol "TOLL_INFO
Erro: error 009: invalid array size (negative, zero or out of bounds)"
Linha do Erro: new aTolls[MAX_PLAYERS][TOLL_INFO];
Код:
Warning: warning 213: tag mismatch
Linha do Warning: aTolls[RichmanToll][E_tOpenTime] = 7;
Код:
Warning: warning 213: tag mismatch
Linha do Warning: aTolls[FlintToll][E_tOpenTime] = 7;
Код:
Warning: warning 213: tag mismatch
Linha do Warning: aTolls[LVToll][E_tOpenTime] = 7;
Код:
Warning: warning 213: tag mismatch
Linha do Warning: aTolls[BlueberryTollR][E_tOpenTime] = 7;
Код:
Warning: warning 213: tag mismatch
Linha do Warning: aTolls[BlueberryTollL][E_tOpenTime] = 7;
Код:
Warning: warning 213: tag mismatch
Linha do Warning: if(aTolls[TollID][E_tOpenTime] > 0)
Код:
Warning: warning 202: number of arguments does not match definition
Linha do Warning: if(GiveMoney(playerid) < TollCost)
Код:
// Por ter varias linhas com o mesmo erro, vai em um code sу:
Warning: warning 213: tag mismatch

aTolls[FlintToll][E_tLocked] = 1;
aTolls[RichmanToll][E_tLocked] = 1;
aTolls[LVToll][E_tLocked] = 1;
aTolls[BlueberryTollR][E_tLocked] = 1;
aTolls[BlueberryTollL][E_tLocked] = 1;
Nгo vou colocar todos, deu vбrios, mais sу deu um warning(warning 213: tag mismatch) em tudo relacionada a "aTolls".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)