Hello,
I have a menu which displays every alive CT. On my local test server it is working fine, on another server, only the first name in the menu is displayed. First of all, here's the code snippet:
Code:
SubMenu(id)
{
new menu = menu_create("\rChoose your opponent:", "submenu_handler");
new iPlayers[32], iNum, playername[32], playerid[2];
get_players(iPlayers, iNum, "ae", "CT");
if (iNum == 0) {
client_print(id, print_chat, "[LR] No alive CTs present.");
menu_destroy(menu);
return PLUGIN_HANDLED;
}
for(new i=0;i<iNum;i++) {
new player=iPlayers[i];
get_user_name(player, playername, 31);
num_to_str(player, playerid, 2);
menu_additem(menu, playername, playerid);
}
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
return PLUGIN_CONTINUE;
}
The most important to mention is: The index-IDs are all correct. I work with them later, and there's no problems with it. But the menu displays something like this:
Choose an opponent:
1: Bla123
2:
3:
4:
If you press "3" now, the script continues fine, but you can't see the name, altough you should. So after the first name, the names aren't displayed, and I can't imagine the problem because it is working on a local testserver. What could be wrong on such a procedure?
Maybe the reason is, that the server is really slow/lame, because 6 servers are running on one machine, and the lookup processes via get_user_name takes too long in this loop, so nothing is displayed?!