Dialog confirm
#1

Hello, how i can add a confirm dialog to this? It's a remove robbery dialog, i wanna add something like: "Are you sure you wish to remove this robbery?"

pawn Код:
case DIALOG_REMOVE_ROBBERY:
        {
            new id = strval(inputtext);
            if(!RobberyData[id][Exists]) return SendClientMessage(playerid, 0xE74C3CFF, "ERROR: {FFFFFF}Robbery doesn't exist.");
            for(new i, mp = GetPlayerPoolSize(); i <= mp; i++)
            {
                if(!IsPlayerConnected(i)) continue;
                if(PlayerRobberyData[i][RobID] == id) Robbery_ResetPlayer(i);
            }

            if(RobberyData[id][Timer] != -1) KillTimer(RobberyData[id][Timer]);
            DestroyDynamicCP(RobberyData[id][Checkpoint]);
            DestroyDynamic3DTextLabel(RobberyData[id][Label]);

            RobberyData[id][OccupiedBy] = RobberyData[id][Timer] = RobberyData[id][Checkpoint] = -1;
            RobberyData[id][Label] = Text3D: -1;
            RobberyData[id][Exists] = false;

            stmt_bind_value(RemoveRobbery, 0, DB::TYPE_INTEGER, id);
            if(stmt_execute(RemoveRobbery)) SendClientMessage(playerid, 0x3498DBFF, "[ROBBERY] {FFFFFF}Robbery removed.");
            return 1;
        }
Reply
#2

Create a second dialog such as DIALOG_REMOVE_ROBBERY_CONFIRM which opens after the initial dialogue - such as

pawn Код:
ShowPlayerDialog(playerid, DIALOG_REMOVE_ROBBERY_CONFIRM, DIALOG_STYLE_INPUT, "etc", "etc", "Select", "Cancel");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)