18.09.2009, 07:44
i didn't understand anything with all those tutorials and examples, how do i use/create it? it is confusing me
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Dialog title","This is a new feature!\nCool, isn't it?","Yes","No");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1) // The dialog ID we assigned the message box to
{
if(response) SendClientMessage(playerid, 0xFFFFFFFF, "Yes? Me too!"); // If they clicked Yes
else SendClientMessage(playerid, 0xFFFFFFFF, "No? Well I think it's cool."); // If they cliked no
}
return 1;
}
public OnPlayerConnect(playerid) { if(playerid == 0) { ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"D ialog title","Error! you are connected to the wrong server you want!","ok","exit","Retry"); } else if(playerid == 1) { ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"D ialog title","Error! your id is not 0!!!","ok","exit","Retry"); } } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 1) // The dialog ID we assigned the message box to { if(response == 0) { SendClientMessage(playerid, 0xFFFFFFFF, "okay!"); // If they clicked "ok" } else if(response == 1) { SendClientMessage(playerid, 0xFFFFFFFF, "okay!"); // If they clicked "exit" } else if(response == 2) { SendClientMessage(playerid, 0xFFFFFFFF, "retrying!"); // If they clicked "retry" } if(dialogid == 2) { if(response == 0) { SendClientMessage(playerid, 0xFFFFFFFF, "okay!"); // If they clicked "ok" } else if(response == 1) { SendClientMessage(playerid, 0xFFFFFFFF, "okay!"); // If they clicked "exit" } else if(response == 2) { SendClientMessage(playerid, 0xFFFFFFFF, "retrying!"); // If they clicked "retry" } } return 1; } |
Originally Posted by Mikep.
If you need help with lists or input boxes, just ask.
|
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Fighting Styles:","Normal\nBoxing\nKung Fu\nKneehead","Use","Cancel");
if(dialogid == 2 && response)
{
switch(listitem)
{
case 0: SetPlayerFightingStyle(playerid, 4);
case 1: SetPlayerFightingStyle(playerid, 5);
case 2: SetPlayerFightingStyle(playerid, 6);
case 3: SetPlayerFightingStyle(playerid, 7);
}
}
ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Send a message","Send a message to everyone!\n\nblablabla text here!\n\nEnter your message below:","Submit","Cancel");
if(dialogid == 3 && response)
{
GameTextForAll(inputtext, 5, 5000);
}