Display dialog problem.
#1

Hey guys.
So I have a problem, my dialog isn't showing. it's a list styled dialog, and listitem 1 and above shows, but listitem 0 doesn't. Here's my code:

pawn Код:
if(dialogid == 27) //buy clothes
    {
        if(response)
        {
            if(listitem == 0) DisplayDialogForPlayer(playerid, 77);
            if(listitem == 1) DisplayDialogForPlayer(playerid, 29);
            if(listitem == 2)
            {
                new biz = GetPlayerVirtualWorld(playerid);
                PlayerInfo[playerid][pHelmet] = 18645;
                GameTextForPlayer(playerid, "~r~-$200", 5000, 1);
                GiveMoney(playerid,-200);
                BizInfo[biz][bTill] += 200;
                BizInfo[biz][bProducts] -= 1;
                PlayerPlaySound(playerid, 1052,0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_GRAD2, "* Helmet purchased, use /helmet to put it on.");
            }
        }
    }
And the reason it's "DisplayDialogForPlayer" is because there's a public function, and so it's actually:
pawn Код:
case 27:
        {
            ShowPlayerDialog(playerid,27,DIALOG_STYLE_LIST,"Clothes","Skin\nBandanas\nHelmet","Done","Cancel");
        }
Like I said, listitem 1 and above works, but 0 doesn't :S
Reply
#2

Hmm: try this:
pawn Код:
if(dialogid == 27) //buy clothes
    {
        if(response)
        {
            if(listitem == 1) DisplayDialogForPlayer(playerid, 77);
            if(listitem == 2) DisplayDialogForPlayer(playerid, 29);
            if(listitem == 3)
            {
                new biz = GetPlayerVirtualWorld(playerid);
                PlayerInfo[playerid][pHelmet] = 18645;
                GameTextForPlayer(playerid, "~r~-$200", 5000, 1);
                GiveMoney(playerid,-200);
                BizInfo[biz][bTill] += 200;
                BizInfo[biz][bProducts] -= 1;
                PlayerPlaySound(playerid, 1052,0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_GRAD2, "* Helmet purchased, use /helmet to put it on.");
            }
        }
    }
Reply
#3

Make sure you aren't using the 77 for anything else.
Reply
#4

Quote:
Originally Posted by Michael@Belgium
Посмотреть сообщение
Hmm: try this:
pawn Код:
if(dialogid == 27) //buy clothes
    {
        if(response)
        {
            if(listitem == 1) DisplayDialogForPlayer(playerid, 77);
            if(listitem == 2) DisplayDialogForPlayer(playerid, 29);
            if(listitem == 3)
            {
                new biz = GetPlayerVirtualWorld(playerid);
                PlayerInfo[playerid][pHelmet] = 18645;
                GameTextForPlayer(playerid, "~r~-$200", 5000, 1);
                GiveMoney(playerid,-200);
                BizInfo[biz][bTill] += 200;
                BizInfo[biz][bProducts] -= 1;
                PlayerPlaySound(playerid, 1052,0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_GRAD2, "* Helmet purchased, use /helmet to put it on.");
            }
        }
    }
Nah, that won't work.. it'll display the next one from what I selected.

@Blood:
Yeah I'm pretty sure I'm not
Reply
#5

Try this one.
pawn Код:
if(dialogid == 27) //buy clothes
{
    if(!response) return 0;
    if(listitem == 0)
    {
        DisplayDialogForPlayer(playerid, 77);
    }
    if(listitem == 1)
    {
        DisplayDialogForPlayer(playerid, 29);
    }
    if(listitem == 2)
    {
        new biz = GetPlayerVirtualWorld(playerid);
        PlayerInfo[playerid][pHelmet] = 18645;
        GameTextForPlayer(playerid, "~r~-$200", 5000, 1);
        GiveMoney(playerid,-200);
        BizInfo[biz][bTill] += 200;
        BizInfo[biz][bProducts] -= 1;
        PlayerPlaySound(playerid, 1052,0.0, 0.0, 0.0);
        SendClientMessage(playerid, COLOR_GRAD2, "* Helmet purchased, use /helmet to put it on.");
    }
}
Reply
#6

Quote:
Originally Posted by [MWR]Blood
Посмотреть сообщение
Try this one.
pawn Код:
if(dialogid == 27) //buy clothes
{
    if(!response) return 0;
    if(listitem == 0)
    {
        DisplayDialogForPlayer(playerid, 77);
    }
    if(listitem == 1)
    {
        DisplayDialogForPlayer(playerid, 29);
    }
    if(listitem == 2)
    {
        new biz = GetPlayerVirtualWorld(playerid);
        PlayerInfo[playerid][pHelmet] = 18645;
        GameTextForPlayer(playerid, "~r~-$200", 5000, 1);
        GiveMoney(playerid,-200);
        BizInfo[biz][bTill] += 200;
        BizInfo[biz][bProducts] -= 1;
        PlayerPlaySound(playerid, 1052,0.0, 0.0, 0.0);
        SendClientMessage(playerid, COLOR_GRAD2, "* Helmet purchased, use /helmet to put it on.");
    }
}
Didn't make a difference, hmm... here's the code for showing the dialog when the users chooses listitem 0:
pawn Код:
case 77:
        {
            new biz = GetPlayerVirtualWorld(playerid);
            format(string, sizeof(string), "%s",BizInfo[biz][bName]);
            ShowPlayerDialog(playerid,77,DIALOG_STYLE_INPUT,string,"Type the skin ID you want below (costs $500):","Buy","Cancel");
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)