29.02.2012, 01:53
Quote:
|
This should work. And I know there is a more efficient way to do it with the string, but for now, you can do it by how many people you have on your server.
PHP код:
|
Use this:
pawn Код:
new users[256],username[MAX_PLAYER_NAME];
//"users" is the string we will format to show all users
//"username" is the string which will be used to get the name of the playerid
for(new i,ii = GetMaxPlayers(); i < ii; i++)
//The above is a for loop checking if i is under the maximum number of players that can enter the server
{
if(IsPlayerConnected(i))
//The above is to check if "i" (from the for loop) is a connected playerid (existing player!)
{
GetPlayerName(i,username,sizeof(username));//Get name of "i" (connected player)
format(users,sizeof(users),"%s\n%s",users,username);
//format the string "users" to be <username> and "\n" to symbolize a new line
}
}
ShowPlayerDialog(playerid,DIALOG_STYLE_LIST,dialogid,"Users",users,"OK","GREAT");


