SA-MP Forums Archive
[Ajuda] Problema 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] Problema com Array (/showthread.php?tid=313603)



[Ajuda] Problema com Array - cotonete - 26.01.2012

Код:
#define PLAYERS_TEAMS 13
enum arrayTteam
{
	NomeTeam[42],
	Skin,
	ArmaID1,AMMO1,
	ArmaID2,AMMO2,
	ArmaID3,AMMO3,
	ArmaID4,AMMO4,
	ArmaID5,AMMO5,
	CorName[25],
	Cor
}

new arrayTeam[PLAYERS_TEAMS][arrayTteam] = {
	{"Mendingos", 137, 27, 100, 28, 350, 24, 500, 16, 5, "Amarelo", 0xffff00ff}, // linha 65 
	{"Japoneses", 123, 30, 175, 24, 500, 8, 1, 32, 350, 18, 5, "Amarelo Claro", 0xffff8dff},
	{"Russos", 125, 27, 100, 31, 175, 16, 5, 24, 500, 4, 1, "Verde", 0x00ff00ff},
	{"Frangos", 18, 5, 29, 350, 26, 100, 15, 1, 34, 65, "Rosa", 0xff8effff}, // linha 68
 	{"Comando Vermelho", 108, 31, 175, 32, 350, 25, 100, 4, 1, 16, 5, "Branco", 0xffffffff},
 	{"Fazendeiros", 162, 33, 65, 32, 350, 30, 175, 6, 1, 16, 1, "Marrom", 0x390000ff},
 	{"Bombeiros", 279, 27, 100, 24, 500, 18, 5, 42, 70, 31, 175, "Laranja", 0xff6100ff},
  	{"BadBoys", 29, 26, 100, 30, 175, 24, 500, 15, 1, 18, 5, "Vermelho", 0xff0000ff},
  	{"Magnatas", 147, 26, 100, 29, 350, 23, 500, 18, 5, 4, 1, "Azul Claro", 0x0078ffff},
  	{"Polўcia", 285, 25, 100, 31, 175, 29, 350, 23, 500, 16, 5, "Azul Escuro", 0x0000ffff},
  	{"Exћrcito", 287, 24, 500, 31, 175, 27, 100, 16, 5, 32, 350, "Verde Limљo", 0x00ff00ff},
  	{"Pilotos", 61, 34, 175, 24, 500, 18, 5, 4, 1, 27, 350, "Roxo", 0xff00ffff},
  	{"Golfistas", 258, 34, 100, 32, 350, 2, 1, 24, 500, 16, 5, "Vinho", 0x321732ff}
};
Код:
D:\Brбulio's Corporation ©\SA-MP Server\gamemodes\SF4FUN.pwn(65) : warning 228: length of initialler exceeds size of the enum field
D:\Brбulio's Corporation ©\SA-MP Server\gamemodes\SF4FUN.pwn(68) : warning 228: length of initialler exceeds size of the enum field
D:\Brбulio's Corporation ©\SA-MP Server\gamemodes\SF4FUN.pwn(68) : error 018: initialization data exceeds declared size
porque acontece isso galera


Re: [Ajuda] Problema com Array - cotonete - 26.01.2012

pronto editado, me ajudem!


Re: [Ajuda] Problema com Array - DreeH - 26.01.2012

pawn Код:
#define PLAYERS_TEAMS 13

enum arrayTteam
{
    NomeTeam[42],
    Skin,
    ArmaID1,AMMO1,
    ArmaID2,AMMO2,
    ArmaID3,AMMO3,
    ArmaID4,AMMO4,
    ArmaID5,AMMO5,
    CorName[25],
    Cor
};

new arrayTeam[PLAYERS_TEAMS][arrayTteam] = {
    ("Mendingos", 137, 27, 100, 28, 350, 24, 500, 16, 5, "Amarelo", 0xffff00ff),
    ("Japoneses", 123, 30, 175, 24, 500, 8, 1, 32, 350, 18, 5, "Amarelo Claro", 0xffff8dff),
    ("Russos", 125, 27, 100, 31, 175, 16, 5, 24, 500, 4, 1, "Verde", 0x00ff00ff),
    ("Frangos", 18, 5, 29, 350, 26, 100, 15, 1, 34, 65, "Rosa", 0xff8effff),
    ("Comando Vermelho", 108, 31, 175, 32, 350, 25, 100, 4, 1, 16, 5, "Branco", 0xffffffff),
    ("Fazendeiros", 162, 33, 65, 32, 350, 30, 175, 6, 1, 16, 1, "Marrom", 0x390000ff),
    ("Bombeiros", 279, 27, 100, 24, 500, 18, 5, 42, 70, 31, 175, "Laranja", 0xff6100ff),
    ("BadBoys", 29, 26, 100, 30, 175, 24, 500, 15, 1, 18, 5, "Vermelho", 0xff0000ff),
    ("Magnatas", 147, 26, 100, 29, 350, 23, 500, 18, 5, 4, 1, "Azul Claro", 0x0078ffff),
    ("Polўcia", 285, 25, 100, 31, 175, 29, 350, 23, 500, 16, 5, "Azul Escuro", 0x0000ffff),
    ("Exћrcito", 287, 24, 500, 31, 175, 27, 100, 16, 5, 32, 350, "Verde Limљo", 0x00ff00ff),
    ("Pilotos", 61, 34, 175, 24, 500, 18, 5, 4, 1, 27, 350, "Roxo", 0xff00ffff),
    ("Golfistas", 258, 34, 100, 32, 350, 2, 1, 24, 500, 16, 5, "Vinho", 0x321732ff)
};
Pronto.


Re: [Ajuda] Problema com Array - DreeH - 26.01.2012

Quote:
Originally Posted by GeForceGT
Посмотреть сообщение
Na Primeira, vocк colocou coisas a mais, e na Segunda vocк colocou coisas a Menos, reveja o CODE e tente...
Nгo tem nada a ver com isso.

A Enum, ele esqueceu de colocar ; no final.
E na Multi Array, ele colocou {}, em cada 'parвmetro', onde na verdade usa-se (),