Portal SAMP
[Ajuda] Inventario em Diloag - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] Inventario em Diloag (/showthread.php?tid=1566)



Inventario em Diloag - MagnatuS - 28/08/2021

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
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(playeridCOLOR_LIGHTRED"Você não pode abrir seu inventário durante um evento.");
    if(EmCombate(playerid))
        return SendClientMessage(playeridCOLOR_LIGHTRED"Você não pode abrir seu inventário durante o combate.");
    if(UserInfo[playerid][user_prisaoid] != -1)
        return SendClientMessage(playeridCOLOR_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_Bufferlinha);
    for(new NumLoop[0]; NumLoop[1]; ++)
    {
        if(
Inventory[playerid][I_SLOT][i] >= -1)
        strcat(gs_Bufferfmat_return("\n%s\t%i\n"Itens[Inventory[playerid][I_SLOT][i]][item_nome], Inventory[playerid][I_UNITY][i]));
    }
    ShowPlayerDialog(playeridDIALOG_INV_ANDROID5"Inventario"gs_Buffer"Selecionar""Fechar");
    
    InventarioAberto
[playerid] = true;

    InventarioMechendo[playerid] = Selecionando;

    ProxDetector(30.0playeridfmat_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] [debugRun time error 4"Array index out of bounds"
[11:29:17] [debugAMX 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 



RE: Inventario em Diloag - xbruno1000x - 28/08/2021

O número de bits de algum array dessas variáveis está extrapolando o valor predeterminado na declaração.