28/08/2021 11:34
bom eu criei um sistema de inventario dialog mais da esse erro alguem sabe resolver ja tentei varias vezes ve se arruma eu nao consigo
comando newkeys para abrir inventario
sistema para abrir inventario
erro que aparece no serve_log
comando newkeys para abrir inventario
Código PHP:
if(newkeys & 131072)
{
if(PlayerAndroid[playerid][isMobile] == false)return ShowInvAndroid(playerid);
ReturnCommand(inventario);
}
sistema para abrir inventario
Código PHP:
stock ShowInvAndroid(playerid)
{
if(UserInfo[playerid][pEvento])
return SendClientMessage(playerid, COLOR_LIGHTRED, "Você não pode abrir seu inventário durante um evento.");
if(EmCombate(playerid))
return SendClientMessage(playerid, COLOR_LIGHTRED, "Você não pode abrir seu inventário durante o combate.");
if(UserInfo[playerid][user_prisaoid] != -1)
return SendClientMessage(playerid, COLOR_LIGHTRED, "Você não pode abrir seu inventário dentro da cadeia.");
new NumLoop[2] = MAX_SLOTS_INV;
switch(PaginaInv[playerid])
{
case 1:
{
NumLoop[0] = 0;
NumLoop[1] = 18;
}
case 2:
{
NumLoop[0] = 18;
NumLoop[1] = 36;
}
case 3:
{
NumLoop[0] = 36;
NumLoop[1] = 54;
}
case 4:
{
NumLoop[0] = 54;
NumLoop[1] = MAX_SLOTS_INV;
}
}
new linha[20];
gs_Buffer[0] = EOS;
format(linha,sizeof(linha), "Item\tQuantidade\n");
strcat(gs_Buffer, linha);
for(new i = NumLoop[0]; i < NumLoop[1]; i ++)
{
if(Inventory[playerid][I_SLOT][i] >= -1)
strcat(gs_Buffer, fmat_return("\n%s\t%i\n", Itens[Inventory[playerid][I_SLOT][i]][item_nome], Inventory[playerid][I_UNITY][i]));
}
ShowPlayerDialog(playerid, DIALOG_INV_ANDROID, 5, "Inventario", gs_Buffer, "Selecionar", "Fechar");
InventarioAberto[playerid] = true;
InventarioMechendo[playerid] = Selecionando;
ProxDetector(30.0, playerid, fmat_return("* %s abriu o inventário.", PlayerGetName(playerid)), COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return true;
}
erro que aparece no serve_log
Código PHP:
[11:29:17] [debug] Run time error 4: "Array index out of bounds"
[11:29:17] [debug] AMX backtrace:
[11:29:17] [debug] #0 0044411c in ?? (0) from Projeto.amx
[11:29:17] [debug] #1 0041d748 in public OnPlayerKeyStateChangeAS (0, 131072, 0) from Projeto.amx
[11:29:17] [debug] #2 0006ebf8 in public OnPlayerKeyStateChange (0, 131072, 0) from Projeto.amx