[Ajuda] Dialog continua abrindo
#1

Olб pessoal, eu tinha feito um post porйm o post estava todo mal organizado entгo decidi fazer um post mais elaborado e com vнdeo para vocкs entenderem melhor sobre o que estб se passando.
Breve explicaзгo: Eu fiz um sistema de que quando o jogador morre e tem itens no inventбrio ele dropa os itens em um objeto no chгo entгo se o player chegar perto desse objeto e apertar "N" uma DIALOG se abre e mostra a quantidade de tais itens que tem e o item, porйm ao jogador quase todos os itens e sobrar 1 na DIALOG ele nгo й removido da DIALOG entгo fica infinitamente lб na DIALOG, e a DIALOG nгo й destruнda.


VНDEO: https://*********/DlR8dF9YzXo


CУDIGO:

Funзгo da Dialog
Код:
take_OnDialogResponse( playerid, dialogid, response, listitem)
{
    if(dialogid == 68)
    {
        if(!response) return 1;
        if(response)
        {
            AddItem( playerid, ItemInfo[ DeadList[ playerid ][ listitem ] ][ Item_Name ], DeadQntList[ playerid ][ listitem ] );
            for( new items; items < MAX_ITEMS; items++)
            {
                new id = GetDeadID( playerid );
                new itemid = PlayerDeadItemID[ items ][ id ];
                if( PlayerDeadItemQnt[ items ][ DeadGet[ playerid ][ listitem ] ] != 0)  
                {
                    if(itemid == DeadList[ playerid ][ listitem ])
                    {
                        PlayerDeadItemQnt[ listitem ][ DeadGet[ playerid ][ listitem ]] = 0;
                        break;
                    }
                }
            }
        }
        return 1;
    }
    return 0;
}
Abrir a dialog
Код:
new DeadGet[ MAX_PLAYERS ][ MAX_ITEMS ];
new DeadList[ MAX_PLAYERS ][ MAX_ITEMS ];
new DeadQntList[ MAX_PLAYERS ][ MAX_ITEMS ];
ShowLooting( playerid )
{
    new text[ 3000 ], subtxt[ 128 ], lootslot;
    for( new items; items < MAX_ITEMS; items++)
    {
        new id = GetDeadID( playerid );
        new itemid = PlayerDeadItemID[ items ][ id ];
        if( PlayerDeadItemQnt[ items ][ id ] > 0) 
        {
            printf( "%d", items );
            DeadGet[ playerid ][ lootslot ] = id;
            DeadList[ playerid ][ lootslot ] = itemid;
            DeadQntList[ playerid ][ lootslot ] = PlayerDeadItemQnt[ items ][ id ];
            // --
            format( subtxt, sizeof subtxt, "%d\t%s\n", PlayerDeadItemQnt[ items ][ id ], ItemInfo[ itemid ][ Item_Name ]);
            strcat( text, subtxt );
            lootslot++;
        }
    }
    ShowPlayerDialog( playerid, 68, DIALOG_STYLE_LIST, "Quantia | Item ", text, "Pegar", "x");
    return 1;
}
Reply
#2

Nгo й aquele
PHP код:
break; 
Nгo? Break cmg sempre buga.
Reply
#3

Quote:
Originally Posted by GuiKommander
Посмотреть сообщение
Nгo й aquele
PHP код:
break; 
Nгo? Break cmg sempre buga.
Nгo jб tentei tirar pra ver se resolvia..
Reply
#4

Quote:
Originally Posted by Meck
Посмотреть сообщение
Nгo jб tentei tirar pra ver se resolvia..
Se nгo for nessa parte, nгo sei
PHP код:
take_OnDialogResponseplayeriddialogidresponselistitem)
{
    if(
dialogid == 68)
    {
        if(!
response) return 1;
        
AddItemplayeridItemInfoDeadListplayerid ][ listitem ] ][ Item_Name ], DeadQntListplayerid ][ listitem ] );
        for( new 
itemsitems MAX_ITEMSitems++)
        {
            new 
id GetDeadIDplayerid );
             new 
itemid PlayerDeadItemIDitems ][ id ];
              if( 
PlayerDeadItemQntitems ][ DeadGetplayerid ][ listitem ] ] != 0)
               {
                if(
itemid == DeadListplayerid ][ listitem ])
                {
                       
PlayerDeadItemQntlistitem ][ DeadGetplayerid ][ listitem ]] = 0;
                }
            }
          }
    }
    return 
0;

Reply
#5

Quote:
Originally Posted by GuiKommander
Посмотреть сообщение
Se nгo for nessa parte, nгo sei
PHP код:
take_OnDialogResponseplayeriddialogidresponselistitem)
{
    if(
dialogid == 68)
    {
        if(!
response) return 1;
        
AddItemplayeridItemInfoDeadListplayerid ][ listitem ] ][ Item_Name ], DeadQntListplayerid ][ listitem ] );
        for( new 
itemsitems MAX_ITEMSitems++)
        {
            new 
id GetDeadIDplayerid );
             new 
itemid PlayerDeadItemIDitems ][ id ];
              if( 
PlayerDeadItemQntitems ][ DeadGetplayerid ][ listitem ] ] != 0)
               {
                if(
itemid == DeadListplayerid ][ listitem ])
                {
                       
PlayerDeadItemQntlistitem ][ DeadGetplayerid ][ listitem ]] = 0;
                }
            }
          }
    }
    return 
0;

Mesma coisa..
Reply
#6

PHP код:
new DeadGetMAX_PLAYERS ][ MAX_ITEMS ];
new 
DeadListMAX_PLAYERS ][ MAX_ITEMS ];
new 
DeadQntListMAX_PLAYERS ][ MAX_ITEMS ];
ShowLootingplayerid )
{
    new 
subtxt128 ], lootslot;
    for( new 
itemsitems MAX_ITEMSitems++)
    {
        new 
id GetDeadIDplayerid );
        new 
itemid PlayerDeadItemIDitems ][ id ];
        if( 
PlayerDeadItemQntitems ][ id ] > 0)
        {
            
printf"%d"items );
            
DeadGetplayerid ][ lootslot ] = id;
            
DeadListplayerid ][ lootslot ] = itemid;
            
DeadQntListplayerid ][ lootslot ] = PlayerDeadItemQntitems ][ id ];
            
formatsubtxtsizeofsubtxt ), "%d\t%s\n"PlayerDeadItemQntitems ][ id ], ItemInfoitemid ][ Item_Name ]);
            
ShowPlayerDialogplayerid68DIALOG_STYLE_LIST"Quantia | Item "subtxt"Pegar""x");
            
lootslot++;
        }
    }
    return 
1;

Vocк tem que ponhar a dialog dentro do loop. Se isso nгo funcionar, Nгo saberei te dizer ;/
Reply
#7

Quote:
Originally Posted by GuiKommander
Посмотреть сообщение
PHP код:
new DeadGetMAX_PLAYERS ][ MAX_ITEMS ];
new 
DeadListMAX_PLAYERS ][ MAX_ITEMS ];
new 
DeadQntListMAX_PLAYERS ][ MAX_ITEMS ];
ShowLootingplayerid )
{
    new 
subtxt128 ], lootslot;
    for( new 
itemsitems MAX_ITEMSitems++)
    {
        new 
id GetDeadIDplayerid );
        new 
itemid PlayerDeadItemIDitems ][ id ];
        if( 
PlayerDeadItemQntitems ][ id ] > 0)
        {
            
printf"%d"items );
            
DeadGetplayerid ][ lootslot ] = id;
            
DeadListplayerid ][ lootslot ] = itemid;
            
DeadQntListplayerid ][ lootslot ] = PlayerDeadItemQntitems ][ id ];
            
formatsubtxtsizeofsubtxt ), "%d\t%s\n"PlayerDeadItemQntitems ][ id ], ItemInfoitemid ][ Item_Name ]);
            
ShowPlayerDialogplayerid68DIALOG_STYLE_LIST"Quantia | Item "subtxt"Pegar""x");
            
lootslot++;
        }
    }
    return 
1;

Vocк tem que ponhar a dialog dentro do loop. Se isso nгo funcionar, Nгo saberei te dizer ;/
mesma coisa..
Reply
#8

Tente fazer um loop pra mostrar os itens que tб aberto
Reply
#9

Quote:
Originally Posted by iSoaD
Посмотреть сообщение
Tente fazer um loop pra mostrar os itens que tб aberto
Tendi nada da sua lуgica
Reply
#10

ATUALIZAЗГO:

SE EU PEGAR O ITEM DE CIMA PRA BAIXO ELE NГO PEGA O ULTIMO, MAS SE EU PEGAR O ITEM DE BAIXO PRA CIMA ELE PEGA TODOS OS ITENS.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)