SA-MP Forums Archive
[ajuda] Dialogs!! - 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] Dialogs!! (/showthread.php?tid=326769)



[ajuda] Dialogs!! - KinX - 18.03.2012

Tipo, eu digito tudo certinho, ai aparece o dialog, mas sempre que eu seleciono alguma coisa, ele fecha e nгo executa nenhuma funзгo,

Alguem ajuda ,plz! darei + REP

Код:
#include <a_samp>
#include <zcmd>
#define COLOR_GREEN 0x33AA33AA

#define Acessorio 2728  
#define Slot 2728

new bool:ComprouGlas1[MAX_PLAYERS];
new bool:ComprouGlas2[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
{

    CMD:Acessorios(playerid, params[]) 
    {
      ShowPlayerDialog(playerid, Acessorio, DIALOG_STYLE_LIST, "Acessorios", "Oculos1\nOculos2", "Selecionar", "Sair");
      return 1;
    }
   CMD:slots(playerid, params[]) 
    {
      ShowPlayerDialog(playerid, Slot, DIALOG_STYLE_LIST, "Slots", "Oculos\nChapeu\nBandana\nBone", "Selecionar", "Sair");
      return 1;

    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == Acessorio)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SendClientMessage(playerid, COLOR_GREEN, "[INFO] Vocк comprou seu oculos , digite /slot para usa-lo");
                ComprouGlas1[playerid] = true;
                return 1;
            }
            else if(listitem == 1)
            {
              SendClientMessage(playerid, COLOR_GREEN, "[INFO] Vocк comprou seu oculos, digite /slot para usa-lo.");
              ComprouGlas2[playerid] = true;
            }
        }
    }
    return 1;
    
    if(dialogid == Slot)
    {
        if(response)
        {
            if(listitem == 0)
            {
               if(ComprouGlas1[playerid] == true)
               {
               SendClientMessage(playerid, 0xAFAFAFAA, "Vocк colocou seus oculos");
               SetPlayerAttachedObject(playerid, 2, 19006, 2, 0.09, 0.04, 0, 88, 75, 0);
               return true;
               }
               SendClientMessage(playerid, COLOR_GREEN, "[BSL]Vocк nгo possui oculos");
               return 1;
            }
            else if(listitem == 1)
            {
              if(ComprouGlas2[playerid] == true)
              {
                SendClientMessage(playerid, COLOR_GREEN, "Vocк colocou seus oculos");
                SetPlayerAttachedObject(playerid, 2, 19007, 2, 0.09, 0.04, 0, 88, 75, 0);
                return true;
                }
                SendClientMessage(playerid, COLOR_GREEN, "[BSL] Vocк nгo possui oculos");
                return 1;
              }
            }
        }
        return 1;
    }
Код:
C:\Users\User4\Desktop\Acessorios e Slots.pwn(48) : warning 225: unreachable code
C:\Users\User4\Desktop\Acessorios e Slots.pwn(71) : warning 217: loose indentation
C:\Users\User4\Desktop\Acessorios e Slots.pwn(76) : warning 217: loose indentation



Re: [ajuda] Dialogs!! - Lucas_Alemao - 18.03.2012

arrumei seu codigo pra vc

pawn Код:
#include <a_samp>
#include <zcmd>
#define COLOR_GREEN 0x33AA33AA

#define Acessorio 2728
#define Slot 2728

new bool:ComprouGlas1[MAX_PLAYERS];
new bool:ComprouGlas2[MAX_PLAYERS];

CMD:Acessorios(playerid, params[])
{
    ShowPlayerDialog(playerid, Acessorio, DIALOG_STYLE_LIST, "Acessorios", "Oculos1\nOculos2", "Selecionar", "Sair");
    return 1;
}

CMD:slots(playerid, params[])
{
    ShowPlayerDialog(playerid, Slot, DIALOG_STYLE_LIST, "Slots", "Oculos\nChapeu\nBandana\nBone", "Selecionar", "Sair");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == Acessorio)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SendClientMessage(playerid, COLOR_GREEN, "[INFO] Vocк comprou seu oculos , digite /slot para usa-lo");
                ComprouGlas1[playerid] = true;
                return 1;
            }
            else if(listitem == 1)
            {
              SendClientMessage(playerid, COLOR_GREEN, "[INFO] Vocк comprou seu oculos, digite /slot para usa-lo.");
              ComprouGlas2[playerid] = true;
            }
        }
    }
    if(dialogid == Slot)
    {
        if(response)
        {
            if(listitem == 0)
            {
               if(ComprouGlas1[playerid] == true)
               {
               SendClientMessage(playerid, 0xAFAFAFAA, "Vocк colocou seus oculos");
               SetPlayerAttachedObject(playerid, 2, 19006, 2, 0.09, 0.04, 0, 88, 75, 0);
               return true;
               }
               SendClientMessage(playerid, COLOR_GREEN, "[BSL]Vocк nгo possui oculos");
               return 1;
            }
            else if(listitem == 1)
            {
                if(ComprouGlas2[playerid] == true)
                {
                    SendClientMessage(playerid, COLOR_GREEN, "Vocк colocou seus oculos");
                    SetPlayerAttachedObject(playerid, 2, 19007, 2, 0.09, 0.04, 0, 88, 75, 0);
                    return true;
                }
                SendClientMessage(playerid, COLOR_GREEN, "[BSL] Vocк nгo possui oculos");
                return 1;
            }
        }
    }
    return 1;
}



Re: [ajuda] Dialogs!! - KinX - 18.03.2012

opa, vamo dar 1 olhada, jaja @edit


Re: [ajuda] Dialogs!! - KinX - 18.03.2012

tipo, os dialogs funcionaram, mas nenhuma funзгo foi executada :S


Re: [ajuda] Dialogs!! - zbt - 18.03.2012

Ambos dialogs, tem o mesmo ID

#define Acessorio 2728
#define Slot 2728

mude


Re: [ajuda] Dialogs!! - Sampizito - 18.03.2012

VocК TEM ALGUM FS? [; Que utilize Dialogs?


Re: [ajuda] Dialogs!! - KinX - 18.03.2012

Quote:
Originally Posted by zbt
Посмотреть сообщение
Ambos dialogs, tem o mesmo ID

#define Acessorio 2728
#define Slot 2728

mude
onde eu vejo esses IDґs ?

@Sampizito

Nгo ;/


Re: [ajuda] Dialogs!! - Lucas_Alemao - 18.03.2012

mude o topo do fs de
pawn Код:
#define Acessorio 2728
#define Slot 2728
para
pawn Код:
#define Acessorio 2728
#define Slot 2729



Re: [ajuda] Dialogs!! - zbt - 18.03.2012

Velho

#define Acessorio 2728
#define Slot 2728

tem o mesmo ID . id й o numero q tб na frente deles. mude um para um numero diferente

EX:

#define Acessorio 2728
#define Slot 2729


Re: [ajuda] Dialogs!! - Sampizito - 18.03.2012

й mermo =D zbt.