Dialog is not closing
#1

Hi all. i have a problem. i have an dialog about changegang. it works to changegang but if i select cancel, it's still changing my gang. why?
pawn Код:
switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
    case DIALOG_GANGCHANGE:// Our dialog!
    {
        switch(listitem)// Checking which listitem was selected
        {
            case 0:// The first item listed
            {
                if(PlayerInfo[playerid] [pTeam] == 0) return SendClientMessage(playerid, -1, "You cannot select the same gang.");
                SetPlayerTeam(playerid, 0);
                PlayerInfo[playerid][pTeam] = 0;
                SetSpawnInfo( playerid, 0,186, 2022.1766,1007.5810,10.8203,270.0330, 0, 0, 0, 0, 0, 0 );
                SpawnPlayer(playerid);
                SendClientMessage(playerid, -1, "Your new gang is {0xAA3333AA}Red Dragon Triad.");
            }
            case 1: // The second item listed
            {
                if(PlayerInfo[playerid] [pTeam] == 1) return SendClientMessage(playerid, -1, "You cannot select the same gang.");
                SetPlayerTeam(playerid, 1);
                PlayerInfo[playerid][pTeam] = 1;
                SetSpawnInfo( playerid, 1, 112, 2194.3840,1676.9290,12.3672,88.4035, 0, 0, 0, 0, 0, 0 );
                SpawnPlayer(playerid);
                SendClientMessage(playerid, -1, "Your new gang is {COL_DARK}The Corleone Family.");
            }
        }
    }
}
Reply
#2

....
Reply
#3

At least show us the rest of the code where you show the dialog, we can't guess what's the reason.
Reply
#4

Yes i was waiting for that only .....
Reply
#5

pawn Код:
CMD:changegang(playerid, params [])
{
    ShowPlayerDialog(playerid, DIALOG_ORDER, DIALOG_STYLE_LIST, "Select your order.","Order 1: Deagle, M4, TEC-9 (5,000$)\nOrder 2:Deagle, M4, TEC-9, Sniper (8,000$)", "Select", "Cancel");
    return 1;
}
Reply
#6

Anyone can help me pls?
Reply
#7

before switch

if(!response) return 0;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)