For a clientsided player list you would need a GuiTextListCtrl, preferably in a GuiScrollCtrl.
Now if you have it, lets say:
- List's name is TL
- GUI's name is PLGui
- The list has 2 columns set, 1 for name and 1 for BL_ID.
Clientsided code:
function PLGui::OnWake(%this) //If we show the GUI.
{
TL.clear(); //Clear the list for updating
commandToServer('RequestPlayers'); //We send a command to the server that we need the players sent to us.
}
function clientCmdAddPlayer(%id,%name,%bl_id) //A clientCmd is the opposite of a serverCmd.
{
TL.addRow(%id,%name TAB %bl_id); //This adds a row, TAB is "\t" or " ", in TextLists it means next column. First argument is the row ID, do not confuse this with the row index.
}
This would request the players onWake and define the clientCmd to add players.
Now the serversided code:
function serverCmdRequestPlayers(%c) //This is the serversided request cmd.
{
%count=clientGroup.getCount(); //Get the clientGroup's count.
for(%i=0;%i<%count;%i++) //Loop through them all.
{
%obj=%c.getObject(%i); //Get the current object we are looping through.
commandToClient(%c,'AddPlayer',%obj,%obj.name,%obj.bl_id); //Command the client to do clientCmdAddPlayer.
}
}
Notes:
- This is untested.
- You might want to change function names.
I took my time in commenting this well, so I hope you won't just copy/paste, but learn from it.
Good luck ;D