Is it possible to parse the player count and show in chat when someone writes !players ? I use an RCON tool.
Solved Parsing player count and showing in chat?
Discussion in 'Rust Discussion' started by Ideal, Jun 3, 2017.
-
You can actually use the community option found in oxide.config.json, which should be in your root folder if you have Oxide installed. That puts your server in the community tab and allows you to install admin plugins. Then you can just run the plugin I posted below and that should solve all your issues!
Code:void OnPlayerChat(ConsoleSystem.Arg arg) { var message = arg.GetString(0); if (message.Contains("!players")) { var playerCount = BasePlayer.activePlayerList.Count; if (playerCount > 1) rust.BroadcastChat($"There are currently {playerCount} players online."); else rust.BroadcastChat("There is currently 1 player online."); } }
Last edited by a moderator: Jul 22, 2017 -
Thank you very much.
-
Any chance to do like !wipe - and it shows the last time it wiped? Can I add that? -
Code:if (message.Contains("!wipe)) { rust.BroadcastChat("This server wipes every Thursday at the Rust update!"); }
-
Wulf Community Admin
-
Code:if (message.Contains("!wipe")) { PrintToChat($"The last wipe was {SaveRestore.SaveCreatedTime}, the next wipe will be *INSERT MESSAGE*."); }
-
Any way to also show "There's 20 players online and 49 joining" etc? -
Also, the "Server Owner" tag is no longer obtainable. -
Hi, I'm really confused on how to make this work.
Can you please help me how to make it work, willing to pay for it -
-
I just can't get this to work. Getting error "User running server may not have access to all service files" (running on Linux)
-
-
It's working now thanks to a PM I received.
I was missing this part:
using Rust;
namespace Oxide.Plugins
{
[Info("PlayerCount", "Hougan", "0.0.1")]
public class PlayerCount : RustPlugin
{
Btw, thx a lot Kappasaurus -
Wulf Community Admin
-
can someone make this into a plugin and pm me it please? I have been looking for this everywhere and i dont know how to code.
Many thanks in advance for your valued time.
StGeorge. -
Wulf Community Admin
-
Playerlist looks at listing the players. It also looks at permissions. I literally want it to state players online and anyone can use the command. I have playerlist installed however only available to admins.
-
Wulf Community Admin
-
can someone PM me with all instructions ? =/