Some problems with dialogs
#1

I have some problem with my dialogs...


Some of them get mixed it example shows up a textthat should be in another

dialog, so it's in same dialogs...


And there is another problem, when you mark some item it will mark the other one so you

can't click it, just if you are fast enough...

Here are the codes to all my dialogs.

I haven't check so very much at them but a bit.

I can dialogs pretty well, but I haven't never had this problem before..

ShowPlayerDialog

pawn Код:
if(pickupid == BuySell)ShowPlayerDialog(playerid, DIALOG_SELLBUY, DIALOG_STYLE_LIST, "Buy or sell something", "Sell\nBuy\t", "Ok", "Channel");
pawn Код:
if(pickupid == CH) ShowPlayerDialog(playerid,DIALOG_CH,DIALOG_STYLE_LIST, "Criminal headquarter", "Enter\nBreak in\t", "Ok", "Cancel"); //sa-mp wiki fцr mer info
    return 1;
pawn Код:
if(pickupid == Infernus) ShowPlayerDialog(playerid,DIALOG_BuyCarD,DIALOG_STYLE_LIST, "Buy a Infernus for 40 000$", "Buy Infernus\t", "Ok", "Cancel");

OnDialogResponse

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
        if(dialogid == DIALOG_CH) //CH = criminal headquarter
    {
        if(response)
        {
       
            if(listitem == 0) // Button 1
            {
                SendClientMessage(playerid,Clown, "Test");
            }
            if(listitem == 1) //Secound item.
            {
                SetPlayerWantedLevel(playerid,3);
                SendClientMessage(playerid,Clowns, "Test"); // Button 2
                SetPlayerPos(playerid,962.2519,2394.0796,-6.4700);
                return 1;
            }
        }
        return 1;
       
        }
        if(dialogid == DIALOG_BuyCarD) //Buy car dialog
    {
        if(response) // If they clicked 'Select' or double-clicked a weapon
        {
            if(listitem == 0) // Button 1
            {
                GetPlayerMoney(playerid);
                GivePlayerMoney(playerid,-40000);
            }
            if(listitem == 1) //Secound item.
            {
                SendClientMessage(playerid, Green, "Test");
            }
            return 1;
            }
    }
        //public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
        ShowPlayerDialog(playerid, DIALOG_SELLBUY, DIALOG_STYLE_LIST, "Buy or sell", "Buy weapons\nSell weapons\t", "Ok", "Cancel");
        if(dialogid == DIALOG_SELLBUY)
        {
            if(response) // If they clicked 'Yes' or pressed enter
            {
                SendClientMessage(playerid, Green, "Test");
            }
            else // Pressed ESC or clicked cancel
            {
                SendClientMessage(playerid, Green, "Test");
            }
            return 1;
        }
        return 0;
    }

Defines:

pawn Код:
#define DIALOG_CH 1 //Criminal head quarter
#define DIALOG_BuyCarD 2
#define DIALOG_SELLBUY 3
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
You are showing dialogs in OnPlayerDialogResponse at the top level - that's probably the issue.
Thanks alot!, I will see if it will work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)