Votemute



  • This game really needs a votemute feature to shut those pesky complainers up without kicking them from the game.



  • Need a working mute feature first.



  • Well, that would be step 1, aye?



  • I would like to mute the vote window.



  • I like the idea so I implemented it for my mod as an admin command to (un)mute single players.
    A muted player is not able to post any messages in chat.

    PlayerController Code (can be used in any mod, just change the PlayerController class):

    var bool isChatMuted; 
    
    exec function AdminMute(optional String PlayerName) {
        ServerListAndSaveMatchingPlayers(PlayerName, "enter \"ConfirmMute X\" in the console to mute player X");
    }
    
    exec function AdminUnmute(optional String PlayerName) {
        ServerListAndSaveMatchingPlayers(PlayerName, "enter \"ConfirmUnmute X\" in the console to unmute player X");
    }
    
    exec function ConfirmMute(int Num) {
        ServerConfirmMute(Num, true);
    }
    
    exec function ConfirmUnmute(int Num) {
        ServerConfirmMute(Num, false);
    }
    
    reliable server function ServerConfirmMute(int Num, bool mute) {
        local SandcastlePC P;
        if(Worldinfo.Game.AccessControl.IsAdmin(self)) {
            if(Num < 0 || Num >= MatchingPlayerControllers.Length) {
                ClientDisplayConsoleMessage("No matching player");
                return;
            }
    
            P = SandcastlePC (MatchingPlayerControllers[Num]);
            if(P == none) {
                ClientDisplayConsoleMessage("Player is invalid (maybe they left?)");
                return;
            }
    
            ClientDisplayConsoleMessage( ( mute ? "Muting" : "Unmuting") @P.PlayerReplicationInfo.PlayerName@"--"@Class'OnlineSubsystem'.static.UniqueNetIdToString(P.PlayerReplicationInfo.UniqueId));
            P.isChatMuted = mute;
        }            
    }
    
    reliable server function SendChatMessage(string Message, EAOCFaction DesignatedTeam) {
        if(!isChatMuted) {
            super.SendChatMessage(Message, DesignatedTeam);
        }
    }
    
    defaultproperties
    {
        isChatMuted = false
    }
    


  • Has to be a modded server though. Coloured servers scare people away.



  • Ooh, I like that lemon, thanks.


Log in to reply