[Ajuda] Erro com Array
#1

Galera, comecei a fazer um FS com enum:

pawn Код:
enum pDados
{
    new pNivelAdm:int,
    new pTrabalho:bool,
    new pDinheiro:int,
    new pPontos:int
}

new
    ArrayDados[MAX_PLAYERS][pDados];

public OnPlayerConnect(playerid)
{
    if(ArrayDados[playerid][pNivelAdm] > 0)
    {
        new name, string[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "O Admin %s acabou de se conectar!!!", name);
        SendClientMessageToAll(COR_AZUL, string);
    }
    return 1;
}
e da esse erro:

pawn Код:
C:\Users\Usuario\Desktop\Brasil Estrada Virtual\filterscripts\SistemAdm.pwn(56) : error 017: undefined symbol "ArrayDados"
C:\Users\Usuario\Desktop\Brasil Estrada Virtual\filterscripts\SistemAdm.pwn(56) : warning 215: expression has no effect
C:\Users\Usuario\Desktop\Brasil Estrada Virtual\filterscripts\SistemAdm.pwn(56) : error 001: expected token: ";", but found "]"
C:\Users\Usuario\Desktop\Brasil Estrada Virtual\filterscripts\SistemAdm.pwn(56) : error 029: invalid expression, assumed zero
C:\Users\Usuario\Desktop\Brasil Estrada Virtual\filterscripts\SistemAdm.pwn(56) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

pawn Код:
enum pDados
{
    pNivelAdm,
    bool:pTrabalho,
    pDinheiro,
    pPontos
}

new ArrayDados[MAX_PLAYERS][pDados];
a de baixo
pawn Код:
public OnPlayerConnect(playerid)
{
    if(ArrayDados[playerid][pNivelAdm] > 0)
    {
        new name[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "O Admin %s acabou de se conectar!!!", name);
        SendClientMessageToAll(COR_AZUL, string);
    }
    return 1;
}
Reply
#3

Ainda da esses erros:

pawn Код:
C:\Users\Usuario\Desktop\Brasil Estrada Virtual\filterscripts\SistemAdm.pwn(55) : error 017: undefined symbol "ArrayDados"
C:\Users\Usuario\Desktop\Brasil Estrada Virtual\filterscripts\SistemAdm.pwn(55) : warning 215: expression has no effect
C:\Users\Usuario\Desktop\Brasil Estrada Virtual\filterscripts\SistemAdm.pwn(55) : error 001: expected token: ";", but found "]"
C:\Users\Usuario\Desktop\Brasil Estrada Virtual\filterscripts\SistemAdm.pwn(55) : error 029: invalid expression, assumed zero
C:\Users\Usuario\Desktop\Brasil Estrada Virtual\filterscripts\SistemAdm.pwn(55) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

manda linha 54, 55, 56 ae
Reply
#5

pawn Код:
53 public OnPlayerConnect(playerid)
54 {
55     if(ArrayDados[playerid][pNivelAdm] > 0)
56     {
57         new name[MAX_PLAYER_NAME], string[128];
58         GetPlayerName(playerid, name, sizeof(name));
59         format(string, sizeof(string), "O Admin %s acabou de se conectar!!!", name);
60         SendClientMessageToAll(COR_AZUL, string);
61     }
62     return 1;
63 }
Reply
#6

Veja se arrumou

PHP код:
 enum pDados
{
    
pNivelAdm,
    
bool:pTrabalho,
    
pDinheiro,
    
pPontos
};
new 
ArrayDados[MAX_PLAYERS][pDados]; 
Reply
#7

cara se ta fazendo alguma coisa errada errada ae, os codigos estгo certos, fiz aqui e compilei normalmente, do jeito que te mandei
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)