SA-MP Forums Archive
Dialog msgbox type. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog msgbox type. (/showthread.php?tid=271523)



Dialog msgbox type. - iGetty - 24.07.2011

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



Re: Dialog msgbox type. - MadeMan - 24.07.2011

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



Re: Dialog msgbox type. - MoroDan - 24.07.2011

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




Re: Dialog msgbox type. - Lee_Percox - 24.07.2011

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.


Re: Dialog msgbox type. - iGetty - 24.07.2011

Thanks guys