09.03.2017, 00:46
I am code optimization.
But you'll have to make sure every dialog ID match.
If EventID is 4 you'll have 10007 + 4, which is 10011, the dialog you want.
The problem starts after the 5th case, where you have the dialog ID as 10014, not matching. If you're able to modify these dialog ids, i'd recommend you to do it this way.
More than optimization, it's organization.
Код:
stock ShowEvents(playerid) { switch(EventID) { case 0: { new string[467], str1[208], str2[217], str3[35]; format(str1, sizeof(str1), "......................................."); format(str2, sizeof(str2), "......................................."); format(str3, sizeof(str3), "......................................."); format(string, sizeof(string), "%s%s%s", str1, str2, str3); ShowPlayerDialog(playerid, 10004, DIALOG_STYLE_LIST, "Events", string, "Ok", "Exit"); } case 1 .. 13: ShowPlayerDialog(playerid, 10007 + EventID, DIALOG_STYLE_LIST, "Events", "Open\nClose\nCount", "Ok", "Exit"); } return 1; }
If EventID is 4 you'll have 10007 + 4, which is 10011, the dialog you want.
The problem starts after the 5th case, where you have the dialog ID as 10014, not matching. If you're able to modify these dialog ids, i'd recommend you to do it this way.
More than optimization, it's organization.