Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Request bonemind's RCON WITHOUT chat writings
#11
Nope I'm still getting the same error!
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#12
!warn herp derping shouldn't show up, except in linux since afaik it does not work.
The herp has been warned for derping should be removed in the warnPlayerCommand method.
Reply

#13
Code:
else if (split[0].Equals("!ban"))
            {
                banCommand(Message, issuer);
                return ChatType.ChatNone;
            }
that's what it's in.
Picture:[Image: Sfoam.png][/quote]

Okay but i'm still getting the same issue for even in ban :/
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#14
(05-16-2012, 00:22)DidUknowiPwn Wrote:
Code:
else if (split[0].Equals("!ban"))
            {
                banCommand(Message, issuer);
                return ChatType.ChatNone;
            }
that's what it's in.
Picture:[Image: Sfoam.png]

Okay but i'm still getting the same issue for even in ban :/
[/quote]

If that doesn't even work, then the new IW update will propably have broken that function as well. return ChatType.ChatNone should relly not make the command show up in the chat

Oh, do you use any other plugins? it may be another plugin that passes the chat to the clients
Reply

#15
I can't even build it because of it. And the IW patch didn't break this, I'll remove OzonE's plugin because his plugin uses chatType.chatNone as well.. I just remembered when I put ChatType.ChatNone in the very end of the coding that error didn't come up.
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#16
Ah I see now. The function needs a bool so it's not OnSay. Just paste the source here with the whole function and OnSay.
[Image: azuw.jpg]
Reply

#17
I'm on my iPhone it's in bonemind's plugin he has released the source already
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#18
(05-16-2012, 18:34)DidUknowiPwn Wrote: I'm on my iPhone it's in bonemind's plugin he has released the source already

Oh yeah...forgot that i did it this way, it expects a boolean, false i think meant don't pass the chat
Reply

#19
So what can we do to fix it? Because this would be a great update to have for the plugin.
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#20
Now that I'm home here's the whole code for CommandClass.cs
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Addon;
using System.Threading;

namespace ServerAdmin
{
    class CommandClass : CPlugin
    {
        Warner warner;
        Langfilter teacher;
        Permissions bouncer;
        Boolean usePermissions;
        Aliaser cloaker;
        Immunitizer untouchables;
        //Mapper maps;
        public CommandClass()
        {
            bouncer = new Permissions();
            usePermissions = bouncer.getPermEnabled();
            warner = new Warner();
            teacher = new Langfilter();
            cloaker = new Aliaser();
            untouchables = new Immunitizer();
            //maps = new Mapper();

        }
        public Boolean execCommand (String Message,ServerClient issuer)
        {
            //Delimiters for splitting of messages
            Char[] delimit = { ' ' };
            //Splitting the message
            String[] split = Message.Split(delimit);
            //Makes sure a nullpointerException is not possible in this function
            if (split[0] == null)
            {
                return true;
            }
            String alias = cloaker.getAlias(split[0].ToLower());
            Message = Message.Replace(split[0], alias);
            split = Message.Split(' ');
            //Checks if a user has permission to issue a command
            if (Message.StartsWith("!") && !bouncer.canIssueCommand(issuer, split[0]))
            {
                TellClient(issuer.ClientNum, "^2You don't have permission to use that", true);
                return false;
            }

            //returns the ping to the issuer, can be given a playername
            if (split[0].Equals("!ping"))
            {
                if (split.Length > 1)
                {
                    ServerClient target = findClient(split[1]);
                    if (target != null)
                    {
                        TellClient(issuer.ClientNum, "^2" + target.Name + "'s ^7ping:^2" + target.Ping, true);
                    }
                    else
                    {
                        TellClient(issuer.ClientNum, "No player was found, multiple were found", true);
                    }
                }
                else
                {
                    TellClient(issuer.ClientNum, "^2Your ping:" + issuer.Ping, true);
                }
                return false;
            }
            //adds an admin to the admin list
            else if (split[0].Equals("!add"))
            {
                if (!(split.Length > 2))
                {
                    TellClient(issuer.ClientNum, "Please enter a group and playername, format: !addadmin groupname playername", true);
                }
                else
                {

                    ServerClient target = findClient(split[2]);
                    if (target == null)
                    {
                        TellClient(issuer.ClientNum,"That user was not found or multiple were found",true);
                    }
                    else
                    {
                        bouncer.setGroup(issuer, split[1], target);    
                    }
                    
                }
                
                return false;
            }
            //Make a player immune
            else if (split[0].Equals("!addimmune"))
            {
                if (!(split.Length > 1))
                {
                    TellClient(issuer.ClientNum, "Please enter a playername", true);
                }
                else
                {
                    ServerClient target = findClient(split[1]);
                    untouchables.addImmune(issuer, target);
                }
                return false;
            }
            //reloads the complete config
            else if (split[0].Equals("!rel"))
            {
                bouncer = new Permissions();
                usePermissions = bouncer.getPermEnabled();
                warner = new Warner();
                teacher = new Langfilter();
                cloaker = new Aliaser();
                untouchables = new Immunitizer();
                TellClient(issuer.ClientNum, "Config reloaded", true);
                return false;
            }
            //returns the player with the highest ping
            else if (split[0].Equals("!maxping"))
            {
                maxPing();
                return false;
            }
            //returns the player with the lowest ping
            else if (split[0].Equals("!minping"))
            {
                minPing();
                return false;
            }
            //FastRestart command, sends map restart to the server
            else if (split[0].Equals("!fastrestart"))
            {
                ServerCommand("map_restart");
                return false;
            }
            //Yell command, Displays text to all clients in HUD
            else if (split[0].Equals("!yell"))
            {
                yellCommand(Message, issuer);
                return false;
            }
            //Returns the name, clientnumber and XUID of the target player(s)
            else if (split[0].Equals("!pi"))
            {
                playerInfo(Message, issuer);
                return false;
            }
            //Returns the name, clientnumber and XUID of the target player(s)
            /*else if (split[0].Equals("!setmap"))
            {
                setMap(Message,issuer);
                return false;
            }
            else if (split[0].Equals("!nextmap"))
            {
                getNextMap();
                return false;
            }*/
            //returns the version of the plugin
            else if (split[0].Equals("!ver"))
            {
                TellClient(issuer.ClientNum, "Bonemind's edit by DidUknowiPwn ingame Rcon, v0.8 BETA w/o Ban/Kick/TB Message LOADED", true);
                return false;
            }
            //returns the players xuid
            else if (split[0].Equals("!xuid"))
            {
                TellClient(issuer.ClientNum, "^2XUID: ^1" + issuer.XUID, true);
                return false;
            }
            //adds a word(s) to the bad language filter
            else if (split[0].Equals("!addword"))
            {
                addToLangFilter(Message, issuer);
                return false;
            }
            //pm's a player with message
            else if (split[0].Equals("!pm"))
            {
                personalMessage(issuer, Message);
                return false;
            }
            //creates an object ruler that tells the issuer the rules
            else if (split[0].Equals("!rules"))
            {
                new Ruler(issuer);
                return false;
            }
            //displays all existing commands
            else if (split[0].Equals("!help"))
            {
                new Helper(issuer);
                return false;
            }
            //issues an rcon command to the server
            else if (split[0].Equals("!rcon"))
            {
                string command = "";
                for (int i = 1; i < split.Length; i++)
                {
                    if (split[i] == null)
                    {
                        return false;
                    }
                    command += split[i] + " ";
                }
                ServerCommand(command.Trim());
                return false;
            }
            //resets the config
            else if (split[0].Equals("!resetconf"))
            {
                SetServerCFG("ServerAdmin", "kickwarnings", "3");
                SetServerCFG("ServerAdmin", "usePermissions", "false");
                SetServerCFG("ServerAdmin", "useLangFilter", "false");
                SetServerCFG("ServerAdmin", "warningTTL", "12");
                SetServerCFG("ServerAdmin", "pmrules", "true");
                SetServerCFG("ServerAdmin", "warningtempban", "true");
                SetServerCFG("ServerAdmin", "kickmessage", "<playername> has been kicked for <reason> by <issuer>");
                SetServerCFG("ServerAdmin", "banmessage", "<playername> has been banned by <issuer>");
                SetServerCFG("ServerAdmin", "connectmessage", "<playername> has connected");
                SetServerCFG("ServerAdmin", "tmpbanmessage", "<playername> has been tempbanned by <issuer>");
                SetServerCFG("ServerAdmin", "warnkickmessage", "<playername> was kicked for <reason>");
                SetServerCFG("ServerAdmin", "warnmessage", "<playername> was warned for <reason>");
                SetServerCFG("ServerAdmin", "unwarnmessage", "<playername> was kicked for <reason>");
                TellClient(issuer.ClientNum, "Config reset", true);
                return false;
            }
            else if (split[0].Equals("!reserved"))
            {
                kickReserved(issuer);
                return false;
            }
              
            //Kick command, invokes kickCommand(String, ServerClient)
            else if (split[0].Equals("!kick"))
            {
                kickCommand(Message, issuer);
                return false;
            }
            //Ban command, invokes banCommand(String, ServerClient)
            else if (split[0].Equals("!ban"))
            {
                banCommand(Message, issuer);
                return false;
            }
            //Kicks by clientnumber, no feedback
            else if (split[0].Equals("!kickc"))
            {
                kickCommandClientNum(Message, issuer);
                return false;
            }
            //bans by clientnumber, no feedback
            else if (split[0].Equals("!banc"))
            {
                banCommandClientNum(Message, issuer);
                return false;
            }
            //issues a warning to the player with optional reason
            else if (split[0].Equals("!warn"))
            {
                warnPlayerCommand(Message, issuer);
                return false;
            }
            //tempbans a player with length kickbantime in sv_config
            else if (split[0].Equals("!tmpban"))
            {
                tempBanCommand(Message, issuer);
                return false;
            }
            //removes a warning to the player?+>_>
            else if (split[0].Equals("!unwarn"))
            {
                unWarnPlayerCommand(Message, issuer);
                return false;
            }
            else
            {
                if (!untouchables.isPlayerImmune(issuer))
                {
                    testLang(Message, issuer);
                }
            }
            return true;
        }

        private static void NewMethod()
        {
            ChatType.ChatNone;
        }
        //Bans a client by clientnumber
        //uses findClient(String name), to find ServerClient
        //uses ServerClient to fetch client number
        void banCommand(String command, ServerClient issuer)
        {
            Char[] delimit = { ' ' };
            String[] split = command.Split(delimit);

            if (!(split.Length > 1))
            {

                TellClient(issuer.ClientNum, "Please enter a playername", true);
                return;
            }
            ServerClient clientResult = findClient(split[1]);
            if (immunityCheck(split[1]))
            {
                ServerClient target = findClient(split[1]);
                TellClient(issuer.ClientNum, target.Name + " is immune to that command.", true);
                return;
            }
            if (clientResult != null)
            {

                ServerCommand("banClient " + clientResult.ClientNum);
                String banmessage = GetServerCFG("ServerAdmin", "banmessage", "^2<playername> ^7has been banned by <issuer>");
                banmessage = banmessage.Replace("<playername>", clientResult.Name);
                banmessage = banmessage.Replace("<issuer>", issuer.Name);
                banmessage = banmessage.Replace("<rank>", bouncer.getUserGroup(issuer.XUID));
                ServerSay(banmessage, false);
            }
            else if (clientResult == null)
            {
                TellClient(issuer.ClientNum, "Could not find username, or multiple were found.", false);
            }

        }
        //Iterates through clientnames to find the correct client
        //If exactly one client is found, returns ServerClient
        //else returns null
        public ServerClient findClient(String clientName)
        {
            clientName = clientName.Trim();
            int clientCount = 0;
            ServerClient client = null;
            System.Collections.Generic.List<ServerClient> clientList = GetClients();
            foreach (ServerClient currClient in clientList)
            {
                if (0 <= currClient.Name.IndexOf(clientName, StringComparison.InvariantCultureIgnoreCase))
                {
                    client = currClient;
                    clientCount++;
                }
            }
            if (clientCount > 1)
            {
                return null;
            }
            else if (clientCount == 1)
            {
                return client;
            }

            return null;
        }
        //Kicks a client by clientnumber
        //uses findClient(String name), to find ServerClient
        //uses ServerClient to fetch client number
        void kickCommand(String command, ServerClient issuer)
        {
            Char[] delimit = { ' ' };
            String[] split = command.Split(delimit);
            ServerClient clientResult;
            if (!(split.Length > 1))
            {
                TellClient(issuer.ClientNum, "Please enter a playername", true);
                return;
            }
            clientResult = findClient(split[1]);
            /*
            if (int.TryParse(split[1], out tmpBanTime))
            {
                clientResult = findClient(split[2]);
            }
            else
            {
                clientResult = findClient(split[1]);
            }
             *
            **/

            
            if (clientResult != null)
            {
                if (immunityCheck(split[1]))
                {
                    ServerClient target = findClient(split[1]);
                    TellClient(issuer.ClientNum, target.Name + " is immune to that command.", true);
                    return;
                }
                String reason = "";
                if (split.Length > 2)
                {

                    
                    for (int i = 2; i < split.Length; i++)
                    {
                        reason += " " + split[i];
                    }
                    reason = warner.reasonParser(reason.Trim());
                    ServerCommand("dropclient " + clientResult.ClientNum + " \"" + reason + "\"");
                }
                else if (split.Length <= 2)
                {
                    ServerCommand("dropclient " + clientResult.ClientNum + " \"See You...\"");
                }
                String kickmessage = GetServerCFG("ServerAdmin", "kickmessage", "^2<playername> ^7has been kicked for ^3<reason> by <issuer>");
                kickmessage = kickmessage.Replace("<playername>", clientResult.Name);
                kickmessage = kickmessage.Replace("<issuer>", issuer.Name);
                kickmessage = kickmessage.Replace("<reason>", reason);
                kickmessage = kickmessage.Replace("<rank>", bouncer.getUserGroup(issuer.XUID));
                ServerSay(kickmessage,false);
            }
            else if (clientResult == null)
            {
                TellClient(issuer.ClientNum, "Could not find username, or multiple were found.", false);
            }


        }
        //kicks a client by clientnumber
        void kickCommandClientNum(String command, ServerClient issuer)
        {
            Char[] delimit = { ' ' };
            String[] split = command.Split(delimit);
            if (!(split.Length > 1))
            {
                TellClient(issuer.ClientNum, "Please enter a player number", true);
                return;
            }
                if (split.Length > 2)
                {
                    String reason = "";
                    for (int i = 2; i < split.Length; i++)
                    {
                        reason += " " + split[i];
                    }
                    reason = warner.reasonParser(reason.Trim());
                    ServerCommand("dropclient " + split[1] + " \"" + reason + "\"");
                }
                else if (split.Length <= 2)
                {
                    ServerCommand("dropclient " + split[1] + " \"See You...\"");
                }
        }
        //bans a client by clientnumber
        void banCommandClientNum(String command, ServerClient issuer)
        {
            Char[] delimit = { ' ' };
            String[] split = command.Split(delimit);
            if (!(split.Length > 1))
            {
                TellClient(issuer.ClientNum, "Please enter a player number", true);
                return;
            }
            if (split.Length > 2)
            {
                String reason = "";
                for (int i = 2; i < split.Length; i++)
                {
                    reason += " " + split[i];
                }
                ServerCommand("banclient " + split[1]);
            }
            else if (split.Length <= 2)
            {
                ServerCommand("banclient " + split[1]);
            }
            TellClient(issuer.ClientNum, "Player kicked", false);




        }
        //yells to a player, or to all players if 'all' is issued
        void yellCommand(String command, ServerClient issuer)
        {
            Char[] delimit = { ' ' };
            String[] split = command.Split(delimit);

            String yellMessage = "";
            if (!(split.Length > 1))
            {
                TellClient(issuer.ClientNum, "Please enter a playername or all", true);
                return;
            }
            ServerClient clientResult = findClient(split[1]);
            for (int i = 2; i < split.Length; i++)
            {
                yellMessage += " " + split[i];
            }
            if (split[1].Equals("all"))
            {
                iPrintLnBold(yellMessage, null);
            }
            else if (clientResult != null)
            {
                iPrintLnBold(yellMessage, clientResult);
            }
            else
            {
                TellClient(issuer.ClientNum, "Could not find username, or multiple were found.", false);
            }

        }
        //fetches the playerinfo of the entered player, or all players
        void playerInfo(String Message, ServerClient issuer)
        {
            System.Collections.Generic.List<ServerClient> clientList = GetClients();
            Char[] delimit = { ' ' };
            String[] split = Message.Split(delimit);
            String name = "";
            for (int i = 1; i < split.Length; i++)
            {
                name += split[i];
                if (i > 1)
                {
                    name += " ";
                }
            }
            if (split.Length == 1)
            {
                Thread statusThread = new Thread(new ParameterizedThreadStart(statusAll));
                statusThread.Start(issuer);
                return;
            }
            foreach (ServerClient currClient in clientList)
            {
                if (currClient.Name.ToLower().Contains(name) || name=="")
                {
                    if (currClient.Name != "")
                    {
                        TellClient(issuer.ClientNum, "^1Name: " + currClient.Name + " ^2Clientnum: " + currClient.ClientNum + " ^3XUID:" + currClient.XUID + " ^1Warnings: " + warner.getWarnings(currClient) + " ^4Group:"
                            + bouncer.getUserGroup(currClient.XUID), true);
                    }
                
                 }

            }
        }
        //issues a warning to a player
        void warnPlayerCommand(String Message, ServerClient issuer)
        {
            char[] delimit = {' '};
            String[] split = Message.Split(delimit);
            if (!(split.Length > 1))
            {

                TellClient(issuer.ClientNum, "Please enter a playername", true);
                return;
            }
            ServerClient target = findClient(split[1]);
            String reason = "";
            Boolean kickPlayer = false;
            if (target != null)
            {
                if (immunityCheck(split[1]))
                {
                    ServerClient cmdtarget = findClient(split[1]);
                    TellClient(issuer.ClientNum, cmdtarget.Name + " is immune to that command.", true);
                    return;
                }
                for (int i = 2; i < split.Length; i++)
                {
                    reason += split[i] + " ";
                }
                reason = warner.reasonParser(reason.Trim());
                kickPlayer = warner.warnPlayer(target, reason);
                Boolean tempbanAfterKick;
                if (!Boolean.TryParse(GetServerCFG("ServerAdmin", "warningtempban", "false"), out tempbanAfterKick))
                {
                    ServerPrint("Could not retrieve warningtempban value, make sure it is true or false");
                }
                if (kickPlayer && !tempbanAfterKick )
                {
                    ServerCommand("dropclient " + target.ClientNum + " \"" + reason + "\"");
                }
                else if (kickPlayer && tempbanAfterKick)
                {
                    ServerCommand("tempbanclient " + target.ClientNum + " \"" + reason + "\"");
                }
            }
            else
            {
                TellClient(issuer.ClientNum, "Could not find player, or multiple were found", true);
            }

        }
        //removes one warning for a player
        void unWarnPlayerCommand(String Message, ServerClient issuer)
        {
            char[] delimit = { ' ' };
            String[] split = Message.Split(delimit);
            if (!(split.Length > 1))
            {
                TellClient(issuer.ClientNum, "Please enter a playername", true);
                return;
            }
            ServerClient target = findClient(split[1]);
            Boolean unWarnSucces = false;
            String reason = "";
            if (target != null)
            {
                for (int i = 2; i < split.Length; i++)
                {
                    reason += split[i] + " ";
                }
                unWarnSucces = warner.unWarnPlayer(target, reason);
                if (!unWarnSucces)
                {
                    TellClient(issuer.ClientNum, "The player does not have any warnings", true);
                }

                
            }
            else
            {
                TellClient(issuer.ClientNum, "Could not find player, or multiple were found", true);
            }

        }
        public void clearWarning(ServerClient client)
        {
            warner.addClient(client);
        }
        //passes the chatmessage to the teacher object, and issues a warning if teacher returns true
        void testLang(String message, ServerClient target)
        {
            if (teacher.issueWarning(message))
            {
                String reason = "Bad language";
                Boolean kickPlayer = false;
                if (target != null)
                {
                    kickPlayer = warner.warnPlayer(target, reason);
                    Boolean tempbanAfterKick = false;
                    if (!Boolean.TryParse(GetServerCFG("ServerAdmin", "warningtempban", "false"), out tempbanAfterKick))
                    {
                        ServerPrint("Could not retrieve warningtempban value, make sure it is true or false");
                    }
                    if (kickPlayer && !tempbanAfterKick)
                    {
                        ServerCommand("dropclient " + target.ClientNum + " " + reason);
                    }
                    else if (kickPlayer && tempbanAfterKick)
                    {
                        ServerCommand("tempbanclient " + target.ClientNum + " " + reason);
                    }
                }
            }
            
        }
        //adds a word or words to the language filter
        void addToLangFilter(String message, ServerClient issuer)
        {
            Char[] delimit = { ' ' };
            String[] split = message.Split(delimit);
            if (!(split.Length > 1))
            {
                TellClient(issuer.ClientNum, "Please enter a word or words", true);
                return;
            }
            for (int i = 1; i < split.Length; i++)
            {
                teacher.addWord(split[i]);

            }
            TellClient(issuer.ClientNum, "Word(s) Added!", true);
        }
        //tempbans a player using kickbantime in sv_config
        void tempBanCommand(String command, ServerClient issuer)
        {
            Char[] delimit = { ' ' };
            int tmpBanTime = 0;
            String[] split = command.Split(delimit);
            ServerClient clientResult;
            if (!(split.Length > 1))
            {
                TellClient(issuer.ClientNum, "Please enter a playername", true);
                return;
            }
            if (int.TryParse(split[1], out tmpBanTime))
            {
                clientResult = findClient(split[2]);
            }
            else
            {
                clientResult = findClient(split[1]);
            }


            if (clientResult != null)
            {
                double tempBanTime;
                try
                {
                    tempBanTime = double.Parse(GetDvar("sv_kickbantime")) / 60;
                }
                catch
                {
                    tempBanTime = 60;
                }
                if (immunityCheck(split[1]))
                {
                    ServerClient target = findClient(split[1]);
                    TellClient(issuer.ClientNum, target.Name + " is immune to that command.", true);
                    return;
                }

                String reason = "";
                if (split.Length > 2)
                {

                    for (int i = 2; i < split.Length; i++)
                    {
                        reason += " " + split[i];
                    }
                    reason = warner.reasonParser(reason.Trim());
                    ServerCommand("tempbanclient " + clientResult.ClientNum + " \"" + reason + "\"");
                }
                else if (split.Length <= 2)
                {
                    ServerCommand("tempbanclient " + clientResult.ClientNum + " \"See You...\"");
                }
                String tmpbanmessage = GetServerCFG("ServerAdmin", "tmpbanmessage", "^2<playername> ^7has been tempbanned for ^3<reason> by <issuer>");
                tmpbanmessage = tmpbanmessage.Replace("<playername>", clientResult.Name);
                tmpbanmessage = tmpbanmessage.Replace("<reason>", reason);
                tmpbanmessage = tmpbanmessage.Replace("<issuer>", issuer.Name);
                tmpbanmessage = tmpbanmessage.Replace("<length>", tmpBanTime.ToString());
                tmpbanmessage = tmpbanmessage.Replace("<rank>", bouncer.getUserGroup(issuer.XUID));
                ServerSay(tmpbanmessage, false);
            }
            else if (clientResult == null)
            {
                TellClient(issuer.ClientNum, "Could not find username, or multiple were found.", false);
            }


        }
        //gets the ping of all players and displays the player with the lowest ping
        void minPing()
        {
            int minping = 10000;
            ServerClient lowestping = null;
            foreach (ServerClient client in GetClients())
            {
                if (client.Ping < minping && client.Name != "")
                {
                    lowestping = client;
                    minping = client.Ping;
                }

            }
            ServerSay("^2" + lowestping.Name + " ^7has the lowest ping: ^2" + lowestping.Ping,true);
        }
        //gets the ping of all players and displays the player with the highest ping
        void maxPing()
        {
            int maxping = 0;
            ServerClient highestping = null;
            foreach (ServerClient client in GetClients())
            {
                if (client.Ping > maxping && client.Name !="")
                {
                    highestping = client;
                    maxping = client.Ping;
                }

            }
            ServerSay("^2" + highestping.Name + " ^7has the highest ping: ^2" + highestping.Ping, true);
        }
        //pm's a player with supplied message
        void personalMessage(ServerClient issuer, String message)
        {
            String[] split = message.Split(' ');
            ServerClient target;
            if (!(split.Length > 1))
            {
                TellClient(issuer.ClientNum, "Please provide a receiver", true);
                return;
            }
            else if (!(split.Length > 2))
            {
                TellClient(issuer.ClientNum, "Please provide a message", true);
                return;
            }
            target = findClient(split[1]);
            if (target == null)
            {
                TellClient(issuer.ClientNum, "Player could not be found, or multiple were found", true);
                return;
            }
            else
            {
                String pmessage = "";
                for (int i = 2; i < split.Length; i++)
                {
                    pmessage += split[i];
                }
                TellClient(target.ClientNum, "^1[PM]^2" + issuer.Name + ":^7 " + pmessage, true);
            }
        }
        Boolean immunityCheck(String name)
        {
            ServerClient target = findClient(name);
            if (target != null && untouchables.isPlayerImmune(target))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        void statusAll(object Admin)
        {
            ServerClient issuer = (ServerClient)Admin;
            List<ServerClient> clientList = GetClients();
            foreach (ServerClient currClient in clientList)
            {
                if (!(currClient.Name == ""))
                {
                    TellClient(issuer.ClientNum, "^1Name: " + currClient.Name + " ^2Clientnum: " + currClient.ClientNum + " ^3XUID:" + currClient.XUID + " ^1Warnings: " + warner.getWarnings(currClient), true);
                    Thread.Sleep(1500);
                }

            }

        }
        public String getRankFromPlayername(String name)
        {
            ServerClient client = findClient(name);
            String group = "User";
            if (client!=null)
            {
                group = bouncer.getUserGroup(client.XUID);
            }
            return group;
        }
        void kickReserved(ServerClient issuer)
        {
            List<ServerClient> clients = GetClients();
            int clientNum = -1;
            int ping = 0;
            foreach (ServerClient client in clients)
            {
                if (bouncer.getUserGroup(client.XUID).Equals("User"))
                {
                    if (client.Ping > ping && client.Ping < 999)
                    {
                        clientNum = client.ClientNum;
                        ping = client.Ping;
                    }
                }

            }
            if (clientNum > -1)
            {
                ServerCommand("dropclient " + clientNum + " \"Making room for members, sorry\"");
            }
            else
            {
                TellClient(issuer.ClientNum, "Could not find suitable client to kick", true);
            }
        }
        /*void setMap(String message, ServerClient issuer)
        {
            String[] split = message.Split(' ');
            if (split.Length >= 2)
            {
                if (maps.setNextMapCommand(split[1]))
                {
                    TellClient(issuer.ClientNum,"The next map has been set to " + split[1], true);

                }
                else
                {
                    TellClient(issuer.ClientNum,"That map was not found",true);
                }
            }
        }
        public void nextMap()
        {
            maps.setNextMapFromFile();
        
        }
        void getNextMap()
        {
            String next = maps.getNextMap();
            if (next.Equals("DISABLED"))
            {
                ServerSay("Custom maplist disabled", true);
            }
            else if (next == "")
            {
                ServerPrint("The next map's name was not found, Check your recipe");
                ServerSay("Next map name not found", true);
            }
            else
            {
                ServerSay("The next map is: ^1 " + next,true);
            }
        }*/
    }
}
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  God Mode Plugin - Everyone has rcon admin srskiller 4 6,095 08-28-2013, 19:03
Last Post: phillipito
  how to remove commands in the chat ExoGamer* 6 4,454 07-20-2013, 09:24
Last Post: Pozzuh
  Help MW3 Admin Rcon login PW guru 6 9,915 07-14-2013, 21:18
Last Post: guru
  [Request] Names, Chat and Scoreboard Mibbix 6 4,538 06-21-2013, 22:16
Last Post: Mibbix
  Help Using chat outside in game Bandarigoda123 1 3,037 06-09-2013, 12:46
Last Post: Nekochan
  [Release] Chat plugin for permissions SgtLegend 9 8,197 06-01-2013, 15:02
Last Post: SgtLegend
  [Release] Chat Locker SgtLegend 13 9,149 05-30-2013, 14:40
Last Post: SgtLegend
  In game chat shanky 12 7,687 04-25-2013, 17:47
Last Post: 8q4s8
  Usual chat Arteq 11 5,995 04-14-2013, 20:48
Last Post: Arteq
  [Request] Is there a Rcon Tool? r2range1 1 3,164 04-11-2013, 00:40
Last Post: hillbilly

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.