Possible?
#4

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.
Reply


Messages In This Thread
Possible? - by KingyKings - 19.12.2011, 22:37
Re: Possible? - by Gamer_Z - 19.12.2011, 22:39
Re: Possible? - by KingyKings - 19.12.2011, 22:42
Re: Possible? - by Rob_Maate - 19.12.2011, 22:52
Re: Possible? - by Gamer_Z - 19.12.2011, 23:03
Re: Possible? - by KingyKings - 19.12.2011, 23:06

Forum Jump:


Users browsing this thread: 1 Guest(s)