1. Is it possible to parse the player count and show in chat when someone writes !players ? I use an RCON tool.
     
  2. 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
  3. Thank you very much.
     
  4. I love you.

    Any chance to do like !wipe - and it shows the last time it wiped? Can I add that? :)
     
  5. Just under the if (message.Contains("!players")) { ... } add the following code.
    Code:
    if (message.Contains("!wipe))
    {
        rust.BroadcastChat("This server wipes every Thursday at the Rust update!");
    }
    You can change the message to your liking. Now, if you do have more messages than that it may be worth adding a dictionary with keys and messages, but for 2 it's not needed.
     
  6. Wulf

    Wulf Community Admin

    PS. Code snippets only please, not entire plugins. ;) The Plugins section is for releases.
     
  7. If you'd like it to be dynamic, which I missed in your message, you can use this.
    Code:
    if (message.Contains("!wipe"))
    {
        PrintToChat($"The last wipe was {SaveRestore.SaveCreatedTime}, the next wipe will be *INSERT MESSAGE*.");
    }
     
  8. It's working! Thanks :D Note: It should be above the !players thing, not below <3

    Any way to also show "There's 20 players online and 49 joining" etc? :)
     
  9. Firstly, if you put it after it should work fine. Secondly, I'm not quite how to access that off the top of my head, but if you were to take your time to find it in a decompiler just continue on my string interpolation. Interpolated Strings (C#)

    Also, the "Server Owner" tag is no longer obtainable.
     
  10. 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
     
  11. What do you want to work, just the player count?
     
  12. I just can't get this to work. Getting error "User running server may not have access to all service files" (running on Linux)
     
  13. Where are you putting it?
     
  14. 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
     
  15. Wulf

    Wulf Community Admin

    Yup, that's the structure of a plugin. ;) We don't allow full plugins to be randomly posted around the forum, only via releases under the Plugin section or via PM if not releasing.
     
  16. 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.
     
  17. Wulf

    Wulf Community Admin

    It already exists and has existed as a plugin long before this thread as PlayerList under Universal Plugins.
     
  18. 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.
     
  19. Wulf

    Wulf Community Admin

    It has an online count command as well as a player name list command, and you can allow anyone to use it as it's permission based. All of this is shown on the Overview.
     
  20. can someone PM me with all instructions ? =/