Dialogs problem
#1

Hello.
I have a problem with some dialogs. I made a comand called /su and i entered :
Код:
ShowPlayerDialog(playerid,DIALOG_WANTED,DIALOG_STYLE_LIST,"SELECTEAZA WANTED","» Wanted 1\n» Wanted 2\n» Wanted 3\n» Wanted 4\n» Wanted 5\n» Wanted 6","Selecteaza","Anuleaza");
And on OnDialogResponse i put this code:
Код:
   if(dialogid == DIALOG_WANTEDD)
    {
        if(response) 
        {
            
            switch(listitem)
            {
                case 0: ShowPlayerDialog(playerid,DIALOG_WANTEDD,DIALOG_STYLE_LIST,"Select the reason","»Rob\n»Kill\n»Surf","Selecteaza","Anuleaza");
                case 1: ShowPlayerDialog(playerid,DIALOG_WANTEDD,DIALOG_STYLE_LIST,"Select the reason 2","»Rob2\n»Kill2\n»Surf2","Selecteaza","Anuleaza");
                
            }
        }
        return 1;
    }
My problem is: When i type /su it is all right, the dialog pops up and i can select on item from there but in the next dialog when i select the second row it gets me to " wanted 2 " from the first dialog.

Ex.I wanna give to a player wanted 1 for killing someone. I cannot do that because the script will turn me back on wanted 2 dialog.


For more details please reply. Sorry for my bad English.
Reply
#2

Код:
ShowPlayerDialog(playerid,DIALOG_WANTED,DIALOG_STYLE_LIST,"SELECTEAZA WANTED","» Wanted 1\n» Wanted 2\n» Wanted 3\n» Wanted 4\n» Wanted 5\n» Wanted 6","Selecteaza","Anuleaza");
Код:
if(dialogid == DIALOG_WANTEDD)
    {
        if(response) 
        {
            
            switch(listitem)
            {
                case 0: ShowPlayerDialog(playerid,DIALOG_WANTEDD,DIALOG_STYLE_LIST,"Select the reason","»Rob\n»Kill\n»Surf","Selecteaza","Anuleaza");
                case 1: ShowPlayerDialog(playerid,DIALOG_WANTEDD,DIALOG_STYLE_LIST,"Select the reason 2","»Rob2\n»Kill2\n»Surf2","Selecteaza","Anuleaza");
                
            }
        }
        return 1;
    }
See the error?
Reply
#3

PHP код:
case 0:
{
    
// code here
}
case 
1:
{
    
// code here

Reply
#4

Quote:
Originally Posted by Lucky13
Посмотреть сообщение
Код:
ShowPlayerDialog(playerid,DIALOG_WANTED,DIALOG_STYLE_LIST,"SELECTEAZA WANTED","» Wanted 1\n» Wanted 2\n» Wanted 3\n» Wanted 4\n» Wanted 5\n» Wanted 6","Selecteaza","Anuleaza");
Код:
if(dialogid == DIALOG_WANTEDD)
    {
        if(response) 
        {
            
            switch(listitem)
            {
                case 0: ShowPlayerDialog(playerid,DIALOG_WANTEDD,DIALOG_STYLE_LIST,"Select the reason","»Rob\n»Kill\n»Surf","Selecteaza","Anuleaza");
                case 1: ShowPlayerDialog(playerid,DIALOG_WANTEDD,DIALOG_STYLE_LIST,"Select the reason 2","»Rob2\n»Kill2\n»Surf2","Selecteaza","Anuleaza");
                
            }
        }
        return 1;
    }
See the error?
I just modify a little bit the code here before i posted it. It's not that the problem.
Reply
#5

Quote:
Originally Posted by saffierr
Посмотреть сообщение
PHP код:
case 0:
{
    
// code here
}
case 
1:
{
    
// code here

What's the difference between
case 0: etc etc

and

case 0:
{
etc etc
}

?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)