Dialog msgbox type.
#1

I don't understand how to make the responses work on DIALOG_STYLE_MSGBOX, please could I get some help?, thanks.

This is the command.

pawn Код:
command(cctv, playerid, params[])
{
    ShowPlayerDialog(playerid, 2525, DIALOG_STYLE_MSGBOX, "CCTV Menu", "Bone County Police Department", "Next", "Close");
    SetPlayerCameraPos(playerid, -1273.0756,2654.4063,72.0765);
    SetPlayerCameraLookAt(playerid, -1280.4012,2705.9097,50.1230);
    return 1;
}
I have this for it, but it just doesn't work, I'm not familiar with MSGBOX typed dialogs.

pawn Код:
case 2525:
            {
                if(!response)
                {
                    SetPlayerPos(playerid, 123.4, 123.4, 123.4);
                    SendClientMessage(playerid, WHITE, "You have cancelled the CCTV menu, and was set back to where you last was.");
                }
                switch(listitem)
                {
                    case 0:
                    {
                        ShowPlayerDialog(playerid, 4568, DIALOG_STYLE_MSGBOX, "CCTV Camera 2", "Bone County Fire/Medic Department", "Next", "Cancel");
                        SetPlayerCameraPos(playerid, 320.0, 50.0, 170.0);
                        SetPlayerCameraLookAt(playerid, 324.34, 54.122, 173.35);
                    }
                }
            }
Reply
#2

pawn Код:
case 2525:
            {
                if(response)
                {
                    ShowPlayerDialog(playerid, 4568, DIALOG_STYLE_MSGBOX, "CCTV Camera 2", "Bone County Fire/Medic Department", "Next", "Cancel");
                    SetPlayerCameraPos(playerid, 320.0, 50.0, 170.0);
                    SetPlayerCameraLookAt(playerid, 324.34, 54.122, 173.35);
                }
                else
                {
                    SetPlayerPos(playerid, 123.4, 123.4, 123.4);
                    SendClientMessage(playerid, WHITE, "You have cancelled the CCTV menu, and was set back to where you last was.");
                }
            }
Reply
#3

Same minute MadeMan .

PHP код:
case 2525:
{
    if(!
response)
    {
        
SetPlayerPos(playerid123.4123.4123.4);
        
SendClientMessage(playeridWHITE"You have cancelled the CCTV menu, and was set back to where you last was.");
    }
    else
    {
        
ShowPlayerDialog(playerid4568DIALOG_STYLE_MSGBOX"CCTV Camera 2""Bone County Fire/Medic Department""Next""Cancel");
        
SetPlayerCameraPos(playerid320.050.0170.0);
        
SetPlayerCameraLookAt(playerid324.3454.122173.35);
    }

Reply
#4

Well with a message box there is no use for listitem. Just use if(!response) do something.. else do something else.

So button left == response button right == !response.

if(!response)
{
SendClientMessage(playerid, CHOOSE_COLOR, "You selected the right button");
return 1;
}

Then code under it would only be executed if the left button was pressed.
Reply
#5

Thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)