23.12.2013, 09:19
instead of always
do:
but you could also use a switch, which would be the best + fastest solution for this
also, i'd recommend defining your Dialog id's lie this:
then instead of 1, you write DM_DIALOG:
ShowPlayerDialog(playerid, DM_DIALOG, DIALOG_STYLE_LIST,"Deathmatch Game","1.Terrorist\n2.Counter-Terrorist\n3.Exit Deathmatch", "Apply", "Close");
and in ondialogresponse too:
if(dialogid == DM_DIALOG)
PHP код:
if(listitem == 0)
if(listitem == 1)
if(listitem == 2)
PHP код:
if(listitem == 0)
else if(listitem == 1)
else if(listitem == 2)
PHP код:
switch(listitem)
{
case 0:
{
//your code
}
case 1:
{
//your code
}
case 2:
{
//your code
}
}
PHP код:
//on top of your script
#define DM_DIALOG 1
#define SOME_DIALOG 2
#define SOME_LIST 3
//and so on, for all your dialogs
ShowPlayerDialog(playerid, DM_DIALOG, DIALOG_STYLE_LIST,"Deathmatch Game","1.Terrorist\n2.Counter-Terrorist\n3.Exit Deathmatch", "Apply", "Close");
and in ondialogresponse too:
if(dialogid == DM_DIALOG)