27.03.2010, 10:42
I've got this:
And how can I make it so that if they press the "FFA" button, it does this:
And the TDM button does this:
I've got this, but it doesn't work:
pawn Код:
public OnPlayerConnect(playerid)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "What do you want to play?", "Pick the type of game you want to play./nFFA = Free For All/nTDM = Team Deathmatch", "FFA", "TDM");
return 1;
}
pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "You picked Free For All.");
pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "You picked Team Deathmatch.");
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
// We SHOULD use switch(dialogid) with cases, but we're only going to use one dialog in this tutorial.
if(dialogid == 1 && response) // If the dialogid is 1 (our dialog) and they pressed 'Purchase'
{
// We'll use the switch/cases now because we're going to process a few results, not just one. Remember, the first item in the list has id 0.
switch(listitem)
{
case 0:
{
SendClientMessage(playerid, COLOR_WHITE, "You picked Free For All.");
}
case 1:
{
SendClientMessage(playerid, COLOR_WHITE, "You picked Team Deathmatch.");
}
}
}
return 1;
}