[ajuda] Dialogs!!
#1

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
Reply
#2

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;
}
Reply
#3

opa, vamo dar 1 olhada, jaja @edit
Reply
#4

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

Ambos dialogs, tem o mesmo ID

#define Acessorio 2728
#define Slot 2728

mude
Reply
#6

VocК TEM ALGUM FS? [; Que utilize Dialogs?
Reply
#7

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 ;/
Reply
#8

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

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
Reply
#10

й mermo =D zbt.
Reply


Forum Jump:


Users browsing this thread: