Weird Dialog Problem
#1

For some reason when i click passport, it works. When i click Gun License and after click buy gun licenses or Guns, nothing pops out.

Dialog
pawn Код:
ShowPlayerDialog(playerid,47,DIALOG_STYLE_LIST,"City hall","Passport\nGun License","Open","Close");
Response to dialog (the problem)
pawn Код:
if(dialogid == 47)
        {
            if(response)
            {
                if(listitem == 0)
                {
                    ShowPlayerDialog(playerid,48,DIALOG_STYLE_LIST,"Passport","Montgomery $1000\nJefferson $1000\nAll Saints $1000","Buy","Close");
                }
                if(listitem == 1)
                {
                    ShowPlayerDialog(playerid,49,DIALOG_STYLE_LIST,"Gun License","Buy Gun Licenses $1000\nGuns","Open","Close");
                }
            }
        }
dialogid 49 and 50
pawn Код:
if(listitem == 49)
        {
            if(response)
            {
                if(listitem == 0)
                {
                    if(PlayerData[playerid][GunLicense] == 1) return SCM(playerid,red,"ERROR: You already have gun licenses");
                    PlayerData[playerid][GunLicense] = 1;
                    SCM(playerid,COLOR_LIGHTBLUE,"You have bought gun licenses, select Guns under Buy Gun Licenses to get a gun everytime");
                    ShowPlayerDialog(playerid,47,DIALOG_STYLE_LIST,"City hall","Passport\nGun License","Open","Close");
                }
                if(listitem == 1)
                {
                    if(PlayerData[playerid][GunLicense] == 0) return SCM(playerid,red,"ERROR: You don't have gun licenses");
                    ShowPlayerDialog(playerid,50,DIALOG_STYLE_LIST,"Guns","Deagle $750\nShotgun $500","Buy","Close");
                }
            }
        }
        if(listitem == 50)
        {
            if(response)
            {
                if(listitem == 0)
                {
                    if(PlayerData[playerid][GunID] == 24) return SCM(playerid,red,"ERROR: You already have a deagle as a gun");
                    SCM(playerid,COLOR_LIGHTBLUE,"You will now spawn with a free deagle");
                    PlayerData[playerid][GunID] = 24;
                    GivePlayerWeapon(playerid,24,100);
                    ShowPlayerDialog(playerid,47,DIALOG_STYLE_LIST,"City hall","Passport\nGun License","Open","Close");
                }
                if(listitem == 1)
                {
                    if(PlayerData[playerid][GunID] == 25) return SCM(playerid,red,"ERROR: You already have a shotgun as a gun");
                    SCM(playerid,COLOR_LIGHTBLUE,"You will now spawn with a free shotgun");
                    PlayerData[playerid][GunID] = 25;
                    GivePlayerWeapon(playerid,25,100);
                    ShowPlayerDialog(playerid,47,DIALOG_STYLE_LIST,"City hall","Passport\nGun License","Open","Close");
                }
            }
        }
Reply
#2

This should work.. Not tested.

pawn Код:
ShowPlayerDialog(playerid, 47, DIALOG_STYLE_LIST, "City hall", "\n1 Passport \n2 Gun License", "Open", "Close");
Reply
#3

doesn't work still the same, well the problem is only with dialogid == 49
Reply
#4

I am sure it will work now:
pawn Код:
if(listitem == 49)
        {
            if(response)
            {
                if(listitem == 0)
                {
                    if(PlayerData[playerid][GunLicense] == 1) return SCM(playerid,red,"ERROR: You already have gun licenses");
                    PlayerData[playerid][GunLicense] = 1;
                    SCM(playerid,COLOR_LIGHTBLUE,"You have bought gun licenses, select Guns under Buy Gun Licenses to get a gun everytime");
                    ShowPlayerDialog(playerid,47,DIALOG_STYLE_LIST,"City hall","Passport\nGun License","Open","Close");
                    return 1;
                }
                if(listitem == 1)
                {
                    if(PlayerData[playerid][GunLicense] == 0) return SCM(playerid,red,"ERROR: You don't have gun licenses");
                    ShowPlayerDialog(playerid,50,DIALOG_STYLE_LIST,"Guns","Deagle $750\nShotgun $500","Buy","Close");
                    return 1;
                }
            }
        }
        if(listitem == 50)
        {
            if(response)
            {
                if(listitem == 0)
                {
                    if(PlayerData[playerid][GunID] == 24) return SCM(playerid,red,"ERROR: You already have a deagle as a gun");
                    SCM(playerid,COLOR_LIGHTBLUE,"You will now spawn with a free deagle");
                    PlayerData[playerid][GunID] = 24;
                    GivePlayerWeapon(playerid,24,100);
                    ShowPlayerDialog(playerid,47,DIALOG_STYLE_LIST,"City hall","Passport\nGun License","Open","Close");
                    return 1;
                }
                if(listitem == 1)
                {
                    if(PlayerData[playerid][GunID] == 25) return SCM(playerid,red,"ERROR: You already have a shotgun as a gun");
                    SCM(playerid,COLOR_LIGHTBLUE,"You will now spawn with a free shotgun");
                    PlayerData[playerid][GunID] = 25;
                    GivePlayerWeapon(playerid,25,100);
                    ShowPlayerDialog(playerid,47,DIALOG_STYLE_LIST,"City hall","Passport\nGun License","Open","Close");
                    return 1;
                }
            }
        }
Some returns are needed.
Reply
#5

Wow, it still doesn't work like seriously whats the problem...
Reply
#6

Ok, made it with cases.. Much better.
Whole public:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 49:
        {
            if(response)
            {
                if(PlayerData[playerid][GunID] == 24) return SCM(playerid,red,"ERROR: You already have a deagle as a gun");
                SCM(playerid,COLOR_LIGHTBLUE,"You will now spawn with a free deagle");
                PlayerData[playerid][GunID] = 24;
                GivePlayerWeapon(playerid,24,100);
                ShowPlayerDialog(playerid,47,DIALOG_STYLE_LIST,"City hall","Passport\n Gun License","Open","Close");
                return 1;
            }
        }
        case 50:
        {
            if(response)
            {
                if(PlayerData[playerid][GunID] == 25) return SCM(playerid,red,"ERROR: You already have a shotgun as a gun");
                SCM(playerid,COLOR_LIGHTBLUE,"You will now spawn with a free shotgun");
                PlayerData[playerid][GunID] = 25;
                GivePlayerWeapon(playerid,25,100);
                ShowPlayerDialog(playerid,47,DIALOG_STYLE_LIST,"City hall","Passport\n Gun License","Open","Close")
                return 1;
            }
        }
    }
    return 0;
}
Reply
#7

dialogid 49 is not buying guns, dialog 50 is.
Reply
#8

if(PlayerData[playerid][GunID] == 24)

If PlayerData[playerid][GunID] == 24) it will not work of-course.. Are you sure it isn't 24 when you try?
Reply
#9

My GunID is 0, i just created Gun Licenses and GunID then i made a checkpoint and updated the city hall cp i made and for some reason Buy Gun Licenses and Guns won't do anything
Reply
#10

Any Error/Warmning?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)