Posts: 1,047
Threads: 23
Joined: Jun 2009
Quote:
Originally Posted by Rob_Maate
It's all very easy mate.
pawn Код:
//You'll need an array of course new OnlinePlayers[MAX_PLAYERS][MAX_PLAYER_NAME];
//In OnGameModeInit for(new i=0; i<MAX_PLAYERS; i++) { OnlinePlayers[playerid] = "$$NULL$$" //Or whatever, I've always used this for a null string }
//In OnPlayerConnect OnlinePlayers[playerid] = GetPlayerName(playerid);
//In OnPlayerDisconnect OnlinePlayers[playerid] = "$$NULL$$"
//Now. Wherever you initialize the updated textdraw, you want this above it new output[1024]; for(new i=0; i<MAX_PLAYERS; i++) { if(strcmp("$$NULL$$", OnlinePlayers[i] != 0) //Doesn't find it { format(output, sizeof(output), "%s%s\n", output, OnlinePlayers[i]); //Add the online player's name to the list } } //Now just print the textdraw WITH "output" as the td-text.
|
new lines for textdraws are prefixed with "~n~" instead of "\n"