SA-MP Forums Archive
Dialog is not closing - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog is not closing (/showthread.php?tid=524792)



Dialog is not closing - prooftzm - 08.07.2014

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.");
            }
        }
    }
}



Re: Dialog is not closing - rockhopper - 08.07.2014

....


Re: Dialog is not closing - Wizzy951 - 08.07.2014

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


Re: Dialog is not closing - rockhopper - 08.07.2014

Yes i was waiting for that only .....


Re: Dialog is not closing - prooftzm - 08.07.2014

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;
}



Re: Dialog is not closing - prooftzm - 08.07.2014

Anyone can help me pls?


Re: Dialog is not closing - Jefff - 08.07.2014

before switch

if(!response) return 0;