Hello
Anyone have a plugin PlayersList to look like:
====Player list. Online:10====
Nick, Nick, .....
======================
i want this >> Online:10
Thanks for help
Players online number
Discussion in 'Hurtworld Discussion' started by Grzeniuuu, Mar 23, 2016.
-
Wulf Community Admin
Have you tried the existing player's list plugin? It wouldn't be hard to edit out the parts you do not want.
-
I want that showed how many players on the server when someone will use the command /players
-
Add something like this to the players list plugin
Code:var playerSessions = GameManager.Instance.GetSessions(); int count=0;foreach (var pair in playerSessions){ count++; } var headermsg = "==== Players List | Online: " + count + " ===="; hurt.SendChatMessage(session, headermsg);
-
You don't need to iterate through all the sessions just to get the player count.
Use:
Code:GameManager.Instance.GetPlayerCount();
Code:hurt.SendChatMessage(session, "Players online: "+GameManager.Instance.GetPlayerCount());
Last edited by a moderator: Mar 25, 2016 -
Thanks!
Maybe now someone will help to change the color
because it does not work > "<silver> Players online: <end>" << -
[DOUBLEPOST=1458893144][/DOUBLEPOST]Code:"<color=silver> Players online: </color>"
-
.Count on any List. No need to loop at all -
Delete server and upload new files.