Blockland Forums > Modification Help
Player list.
(1/3) > >>
MrPickle:
How do you make a player list, i copy && pasted one from the Admin Gui it makes mine work but then the admin gui one stops working, help....
Aloshi:
Try using the F2 list instead of Admin GUI.
Space Guy:
Add-Ons/Client/MrP_PlayerListGUI_Client.cs

--- Code: ---exec("./MrP_PlayerListGUI.gui"); //Or copy paste the code in the GUI file here
function MrP_PlayerListGui::OnWake(%this)
{
 commandtoserver('getMrPPlayerList');
}

function clientcmdUpdateGUI(%obj,%action,%arg1,%arg2)
{
switch$(%action)
{
case "listClear": %obj.clear();
case "listRow": %obj.addRow(%arg1, %arg2);
case "textSet": %obj.setText(%arg1);
}
}
--- End code ---

Add-Ons/MrP_PlayerListGUI_Server.cs

--- Code: ---function servercmdgetMrPPlayerList(%client)
{
 commandtoclient(%client,'updateGUI',"MrP_PlayerList","listClear");
 for(%i=0;%i<ClientGroup.getCount();%i--)
 {
  %cl=ClientGroup.getObject(%i);
  %tag = (%cl.isAdmin ? "[A]" : "");
  %tag = (%cl.isSuperAdmin ? "[S]" : %tag);
  %tag = (%cl.getRawIP() $= "local" ? "[H]" : %tag);
  commandtoclient(%client,'updateGUI',"MrP_PlayerList","listRow",%i,%cl.name TAB %tag);
 }
}
--- End code ---

Clients will have to download the GUI and client file before using it. The GUI will not update if a client leaves or becomes admin while it is open. I'm not sure whether the [H] tag works, most likely you will show up as (SuperAdmin).

The GUI should contain a copy of the admin player list, but with the list itself renamed to "MrP_PlayerList" and the GUI called "MrP_PlayerListGui". You will need to add your own toggle command.
Terror:
Space. You could use findLocalClient(); instead.
Spation:

--- Quote from: MrPickle ---When i open up the GUI it says: Set::getObject index out of range on ClientGroup. Index = -1, Size = 1

--- End quote ---
Navigation
Message Index
Next page

Go to full version