SA-MP Forums Archive
dialog not working when a option is selected. - 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 not working when a option is selected. (/showthread.php?tid=369336)



dialog not working when a option is selected. - TaLhA XIV - 16.08.2012

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 200)//our dialog!
    
{
        if(
response)// They pressed the first button.
        
{
            switch(
listitem)
            {
                case 
0:// The first item listed
                
{
                    
SetPlayerCameraPos(playerid,-2783.7910,-359.3125,27.1710);
                    
SetPlayerCameraLookAt(playerid,-2770.6438,-305.3811,7.0391,CAMERA_CUT);
                }
                case 
1// The second item listed
                
{
                    
SetPlayerCameraPos(playerid,-2681.1904,-280.9120,27.1677);
                    
SetPlayerCameraLookAt(playerid,-2681.0308,-258.1010,7.0489,CAMERA_CUT);
                }
                case 
2// The third item listed
                
{
                      
SetPlayerCameraPos(playerid,-2788.5583,-399.1039,27.1829);
                    
SetPlayerCameraLookAt(playerid,-2802.2390,-474.2502,7.1875,CAMERA_CUT);
                }
            }
            return 
1;
        }
        if(!
response)
        {
            
ShowPlayerDialog(playerid,-1,-1,"","","","");
            return 
1;
        }
    }
    return 
0;

PLease why is this not working.I just don't like dialogs.Please help.
ThAnKs!


Re: dialog not working when a option is selected. - Kindred - 16.08.2012

Are you sure the dialog you are using uses the correct dialogid? Like, is the dialogid correct? (200 inside ShowPlayerDialog)

Plus, make sure it is DIALOG_STYLE_LIST.


Re: dialog not working when a option is selected. - FalconX - 16.08.2012

if it's a filterscript try moving it to the first place like this:

pawn Код:
filterscripts your_dialog_script[put here] admin_system and other shiz



Re: dialog not working when a option is selected. - TaLhA XIV - 16.08.2012

No no.The dialog shows up but when I select a option but nothing happens and the dialog closes.


Re: dialog not working when a option is selected. - Henkie - 16.08.2012

Quote:
Originally Posted by TaLhA XIV
Посмотреть сообщение
No no.The dialog shows up but when I select a option but nothing happens and the dialog closes.
You need to change the players mode to "Spectating".

https://sampwiki.blast.hk/wiki/TogglePlayerSpectating

I guess this will solve the problem.


Re: dialog not working when a option is selected. - Sandiel - 16.08.2012

Remove the Return 1; in the "response check".
Also, make sure the DialogID is the correct one, tip: use defines next time to not get confilcted dialog ids.
Hmm, moreover, try re-creating the dialog, maybe you'll spot something wrong somewhere else in your script.


Re: dialog not working when a option is selected. - TaLhA XIV - 16.08.2012

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/cctv"cmdtexttrue10) == 0)
    {
        
ShowPlayerDialog(playerid200DIALOG_STYLE_LIST"What is it that you want?""CCTV [1]\nCCTV [2]\nCCTV [3]""View""Cancel");
        return 
1;
    }
    return 
0;
}

public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 200)//our dialog!
    
{
        if(
response)// They pressed the first button.
        
{
            switch(
listitem)
            {
                case 
0:// The first item listed
                
{
                    
SetPlayerCameraPos(playerid,-2783.7910,-359.3125,27.1710);
                    
SetPlayerCameraLookAt(playerid,-2770.6438,-305.3811,7.0391,CAMERA_CUT);
                }
                case 
1// The second item listed
                
{
                    
SetPlayerCameraPos(playerid,-2681.1904,-280.9120,27.1677);
                    
SetPlayerCameraLookAt(playerid,-2681.0308,-258.1010,7.0489,CAMERA_CUT);
                }
                case 
2// The third item listed
                
{
                      
SetPlayerCameraPos(playerid,-2788.5583,-399.1039,27.1829);
                    
SetPlayerCameraLookAt(playerid,-2802.2390,-474.2502,7.1875,CAMERA_CUT);
                }
            }
        }
        if(!
response)
        {
            
ShowPlayerDialog(playerid,-1,-1,"","","","");
            return 
1;
        }
    }
    return 
0;

Still not working.


Re: dialog not working when a option is selected. - TaLhA XIV - 16.08.2012

anyone?


Re: dialog not working when a option is selected. - TaLhA XIV - 16.08.2012

Sorry but anyone.