18.03.2012, 06:53
for the first error, you've looped through all players so the dialog shouldn't be shown to "playerid" but to "i" so
must be
for the second error it's all about the brackets, here it should be fine
pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "what floor do you want?", "Ground floor /nFirst Floor /nSecond Floor /nThirdFloor /nFourth Floor /nFifth Floor /nSixthFloor /nSeventh Floor /nEighth Floor /nNineth Floor /nTenthfloor /nEleventh Floor /nTwelefth Floor /nThirteenth Floor /nFourteenth Floor /nFifteenth Floor /nSixteenth Floor /nSeventeenth Floor /nEighteenth Floor /nNineteenth Floor /nRoof", "Select", "Cancel");
pawn Код:
ShowPlayerDialog(i, 1, DIALOG_STYLE_LIST, "what floor do you want?", "Ground floor /nFirst Floor /nSecond Floor /nThirdFloor /nFourth Floor /nFifth Floor /nSixthFloor /nSeventh Floor /nEighth Floor /nNineth Floor /nTenthfloor /nEleventh Floor /nTwelefth Floor /nThirteenth Floor /nFourteenth Floor /nFifteenth Floor /nSixteenth Floor /nSeventeenth Floor /nEighteenth Floor /nNineteenth Floor /nRoof", "Select", "Cancel");
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
{
switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
case 1:// Our dialog!
{
switch(listitem)// Checking which listitem was selected
{
case 0:
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100);}
case 1: //Ground
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (1 * 5.45155));}
case 2: //First
{SetPlayerPos(playerid, -1916.9716,1112.4375,48.7100+ 8.7396 + (2 * 5.45155));}
case 3: //Second
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (3 * 5.45155));}
case 4: //Third
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (4 * 5.45155) );}
case 5: //Fourth
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (5 * 5.45155));}
case 6: //Fifth
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (6 * 5.45155));}
case 7: //Sixth
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (7 * 5.45155));}
case 8: //Seventh
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (8 * 5.45155));}
case 9: //Eighth
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (9 * 5.45155));}
case 10: //Ninth
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (10 * 5.45155));}
case 11: //Tenth
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (11 * 5.45155));}
case 12: //Eleventh
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (12 * 5.45155));}
case 13: //Twelth
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (13 * 5.45155));}
case 14: //Thirteenth
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (14 * 5.45155));}
case 15: //Fourteenth
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (15 * 5.45155));}
case 16: //Fifteenth
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (16 * 5.45155));}
case 17: //Sixteenth
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (17 * 5.45155));}
case 18: //Seventeenth
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (18 * 5.45155));}
case 19: //Eighteenth
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (19 * 5.45155));}
case 20: //Nineteenth
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (20 * 5.45155));}
case 21: //Penthouse
{SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (21 * 5.45155));}
}
}
}
}
return 1;
}