31.05.2015, 00:19
Hi,
I tried to make a command to show all players online using this code:
I tested this with two players but it's showing only the player with the lower id.
I tried to make a command to show all players online using this code:
Код:
CMD:onlineplayers(playerid, params[]) { new Tabs[500], List[500]; for (new i; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { format(Tabs, 500, "Player\tID\n%s\n", List); format(List, 500, "%s%s\t%i\n", List, GetName(i), i); } } if (strlen(List) > 0) ShowPlayerDialog(playerid, 1, DIALOG_STYLE_TABLIST_HEADERS, "Online Players:", Tabs, "Close", ""); return 1; }