dialogs
#1

hello

when i press "Confirm" the msgbox doesnt go away it keep staying there

pawn Код:
if(dialogid == 2)
    {
        ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Test","Test","Confirm","");
        return 0;
    }
    return 1;
}
Reply
#2

pawn Код:
if(response && dialogid == 2) // If press left button of dialog and dialogid be 2
{
      ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Test","Test","Confirm","");
      return 0;
}
Also on the end of callback OnDialogResponse, put return 0; instead return 1; , for avoid bugs.
Reply
#3

I still cant remove it :S
Reply
#4

if(response == 1)
{
SendClientMessage(playerid,ur color,"Add this above your dialog,and I hope it works");
}
Reply
#5

You're stuck in a infinite loop right there. When you click on a button, OnDialogResponse gets called, and it will show that same message again and again, because you use the same dialogid.
Reply
#6

Then how to fix it vince?
Reply
#7

Use another dialogid. Or set a variable and then check it. Use your imagination.
Reply
#8

Quote:

if(dialogid == 2)
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"T est","Test","Confirm","");
return 0;
}
return 1;
}

see you are using dialog response of dialog id 2,
but you have returned out same dialog id

in this line
pawn Код:
ShowPlayerDialog(playerid,[b]2[/b],DIALOG_STYLE_MSGBOX,"Test","Test","Confirm","");
your are retuning back dialog id 2 , instead you are supposed to use another dialog which is your next one .
Reply
#9

Quote:
Originally Posted by Jagat
Посмотреть сообщение
your are retuning back dialog id 2 , instead you are supposed to use another dialog which is your next one .
But I dont need a next dialog.

All I need is when players see that MSG box, they press Confirm (only 1 buttom) and then the msg box will be gone (ofc it will pop up again when they type a cmd)
Reply
#10

Quote:
Originally Posted by fissekarl
Посмотреть сообщение
But I dont need a next dialog.

All I need is when players see that MSG box, they press Confirm (only 1 buttom) and then the msg box will be gone (ofc it will pop up again when they type a cmd)
but post your cmd here plz . You use zcmd ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)