1. I'd like to hide player name tags on my server, to make the game more realistic
    (We dont walk around with nametags in real life :))

    I found the below server command, but it doesnt seem to be working:

    nametags.enabled false

    is this an outdated command?

    is there a plugin that can hide name tags?

    References:
     
  2. Wulf

    Wulf Community Admin

    The name tag in Rust is based on range, which is handled by the client, not the server. So it's unlikely you'd be able to change it. I believe each client would have to run that command if it still exists, as it's a client-command, not a server command as far as I know.
     
  3. Wulf

    Wulf Community Admin

    That might work, give it a try!
     
  4. You would force then the clients to disable their tag settings, but they would return it anyway..not the best solution for an not possible solution over long time ;)
     
  5. I think it would be possible to periodically loop through active player list and run command every X seconds?
     
  6. Wulf

    Wulf Community Admin

    Yes, but that wouldn't be ideal for server performance.
     
  7. Maybe run it when the server saves. Or on some other event that wont cause server performance issues.
     
  8. Wulf

    Wulf Community Admin

    Yeah, but then there is a high chance that many players would have re-enabled it between that time.
     
  9. Very true I suppose. Are there any hooks that allow us to detect when a player changes one of those options? Or is that purely client side.
     
  10. Wulf

    Wulf Community Admin

    It's client-side, so the server would never know.
     
  11. Looping through active players isn't all that harmful on server performance, and you wouldn't have to do it more than every few (5-10? or more) seconds. The only case in which you'd need to do it super quickly is if someone has a bind set to re-enable them.
     
  12. Untested, would this work?
    Code:
    private Timer _timer;void Init()
    {
        _timer = timer.Repeat( 5, 0,  () =>
        {
             foreach (var player in BasePlayer.activePlayerList)
                  player.SendConsoleCommand("nametags.enabled false");
         });
    }void Unload()
    {
        if (!_timer.Destroyed)
            _timer.Destroy();
    }
     
  13. You shouldn't need to destroy the timer. As it seems to auto-destroy when the plugin itself unloads. Of course you can take these precautions if you wish. And you can stuff that repeat function within loaded as well. I would personally just make a separate function to do it(personally to keep the code cleaner/neat).
    Code:
            void Loaded()
            {
                Repeat_Function();
            }        void Repeat_Function(){
                timer.Repeat(5, 0, () =>
                {
                    //Debug
                        Puts("Debug");
                    //Debug
                    foreach (var player in BasePlayer.activePlayerList){
                         player.SendConsoleCommand("nametags.enabled false");   
                    } 
                });
            }
    
     
  14. Wulf

    Wulf Community Admin

    I'm not talking about the actual looping, I'm talking about the rapid amount of looping, timers, and client commands all mixed together into a spamfest to keep it disabled.
     
  15. As far as I know, SendConsoleCommand isn't slow. If you have a timer on your server init to run every 5 seconds that loops through all players and sends the nametag command, it should take ~1-2 milliseconds in most cases, unless I'm mistaken?
     
  16. I really like the word spamfest :p But not what it does.
    You are complete right, that could become really crazy.
    Some game functions need simply to be taken like they are provided.
     
  17. Wulf

    Wulf Community Admin

    Not saying it is slow, just saying that it can potentially cause issues being spammed very rapidly to all players, for both the server and the client. I've not tried with this command, but in the past users have had performance issues on their client with similar situations.
     
  18. Would it be possible to only run that automatic client commands script during an event? I would like all clients to disable name tags while in the slasher event, then re-enable (if it was enabled prior) after the event.