[Ajuda] Erro com Array - 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] Erro com Array (
/showthread.php?tid=479859)
Erro com Array -
8235Danilo - 07.12.2013
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.
Re: Erro com Array -
GM_KoDi - 07.12.2013
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;
}
Re: Erro com Array -
8235Danilo - 07.12.2013
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.
Re: Erro com Array -
GM_KoDi - 07.12.2013
manda linha 54, 55, 56 ae
Re: Erro com Array -
8235Danilo - 07.12.2013
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 }
Re: Erro com Array -
yiakin - 07.12.2013
Veja se arrumou
PHP код:
enum pDados
{
pNivelAdm,
bool:pTrabalho,
pDinheiro,
pPontos
};
new ArrayDados[MAX_PLAYERS][pDados];
Re: Erro com Array -
GM_KoDi - 07.12.2013
cara se ta fazendo alguma coisa errada errada ae, os codigos estгo certos, fiz aqui e compilei normalmente, do jeito que te mandei