Add-Ons/Client/MrP_PlayerListGUI_Client.cs
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);
}
}
Add-Ons/MrP_PlayerListGUI_Server.cs
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);
}
}
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.