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



Ajuda Array - 3War - 28.12.2018

Este й meu array

Код:
new Items[][][] = //ID ARMA, NOME, MUNIЗГO/QUANTIDADE , MODELO ID
{
    {1,     "Soco Ingles",       1,  331, false},
    {4,     "Faca",              1,  335, false},
    {5,     "Baseball",          1,  336, false},
    {6,     "Pa",                1,  337, false},
    {9,     "Serra",             1,  341, false},
    {16,    "Granada",           1,  342, false},
    {17,    "Bomba de Gas",      1,  343, false},
    {22,    "9mm",               30, 346, false},
    {23,    "9mm Custom",        30, 347, false},
    {25,    "Shotgun Simples",   30, 349, false},
    {27,    "Shotgun Custom",    30, 351, false},
    {28,    "Uzi",               30, 352, false},
    {29,    "MP5",               30, 353, false},
    {30,    "AK-47",             30, 355, false},
    {31,    "M4",                30, 356, false},
    {33,    "Espingarda",        30, 356, false},
    {44,    "Oculos Noturno",    20, 368, false},
    {46,    "Paraquedas",        1,  371, false},
    {47,    "KitMedico",         1,  1240, false},
    {48,    "Colete",            1,  1242, false},
    {49,    "Muniзao",           30,  1279, false},
    {50,    "Dinheiro",          1000,  1212, false}
};
Este й um exemplo de utilizaзгo do mesmo

Код:
CMD:criar(playerid)
{
	CreateObject(Items[0][4], 1958.3783, 1343.1572, 15.3746, 0.0, 0.0, 0.0);
	return 1;
}
Erro ao compilar

Quote:

error 035: argument type mismatch (argument 1)

Quando vou utilizar essa array Items,em qualquer posiзao,a mesma retorna esse erro.Nгo estou sabendo o motivo
Alguem pode me ajudar? Aparentemente nao consigo utilizar nenhuma posiзгo da array.

o mesmo acontece se a declaraзгo da variavel array for assim:
Quote:

new Items[22][5][20]




Re: Ajuda Array - Injury - 28.12.2018

Vocк precisa de um enumerador

Код:
enum e_Items
{
    itemArmaID,
    itemNome[32],
    itemMuni,
    itemModelo,
    bool:itemAlgumaCoisa
}

new Items[][e_Items] = 
{
    {1,     "Soco Ingles",       1,  331, false},
    {4,     "Faca",              1,  335, false},
    {5,     "Baseball",          1,  336, false},
    {6,     "Pa",                1,  337, false},
    {9,     "Serra",             1,  341, false},
    {16,    "Granada",           1,  342, false},
    {17,    "Bomba de Gas",      1,  343, false},
    {22,    "9mm",               30, 346, false},
    {23,    "9mm Custom",        30, 347, false},
    {25,    "Shotgun Simples",   30, 349, false},
    {27,    "Shotgun Custom",    30, 351, false},
    {28,    "Uzi",               30, 352, false},
    {29,    "MP5",               30, 353, false},
    {30,    "AK-47",             30, 355, false},
    {31,    "M4",                30, 356, false},
    {33,    "Espingarda",        30, 356, false},
    {44,    "Oculos Noturno",    20, 368, false},
    {46,    "Paraquedas",        1,  371, false},
    {47,    "KitMedico",         1,  1240, false},
    {48,    "Colete",            1,  1242, false},
    {49,    "Muniзao",           30,  1279, false},
    {50,    "Dinheiro",          1000,  1212, false}
};




CMD:criar(playerid)
{
	CreateObject(Items[0][itemModelo], 1958.3783, 1343.1572, 15.3746, 0.0, 0.0, 0.0);
	return 1;
}



Re: Ajuda Array - 3War - 28.12.2018

Algo tao simples kkk'...Obrigado mestre!