18.09.2009, 10:00
You can only have 2 buttons, sorry.
Prehaps you can have 1 or 3 in the future, because I think "Welcome to my server! OK Cancel" is a strange button to have, but what else could it be..
Anyway, for lists, you basically do something like this.
Also, if you aren't going to do any code when they press Cancel, we can make the codein here shorter:
listitem - The ID of the item they selected (first is 0)
inputtext - The name of the item
Now for the input box.
Prehaps you can have 1 or 3 in the future, because I think "Welcome to my server! OK Cancel" is a strange button to have, but what else could it be..
Anyway, for lists, you basically do something like this.
pawn Код:
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Fighting Styles:","Normal\nBoxing\nKung Fu\nKneehead","Use","Cancel");
pawn Код:
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);
}
}
inputtext - The name of the item
Now for the input box.
pawn Код:
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");
pawn Код:
if(dialogid == 3 && response)
{
GameTextForAll(inputtext, 5, 5000);
}