dialog not working when a option is selected.
#1

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!
Reply
#2

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.
Reply
#3

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
Reply
#4

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

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.
Reply
#6

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.
Reply
#7

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.
Reply
#8

anyone?
Reply
#9

Sorry but anyone.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)