Пример #1
0
        // chat commands:
        // /kick <username>
        // /kickid <steam64id>
        // /ssay <message to say as server>
        // /ban <>
        // /banid <>
        // /rl
        // /reload
        // unban <>
        object OnEvent(ChatEvent ev)
        {
            string user = ev.RaisedBy.GetPlayerConnection().SteamID.m_SteamID.ToString();

            if (bans.Contains(user))
            {
                BoltConnection boltConnection = ev.RaisedBy;
                RefuseToken    refuseToken1   = new RefuseToken();
                refuseToken1.RefuseReason = "Banned by admin.";
                RefuseToken refuseToken2 = refuseToken1;
                boltConnection.Disconnect((IProtocolToken)refuseToken2);
                return(true);
            }

            if (admins.IndexOf(user) == -1)
            {
                return(null);
            }
            string cmd = ev.Text;

            if (cmd.StartsWith("/"))
            {
                ev.Text = "";
            }
            else
            {
                return(null);
            }
            //ssay
            if (cmd.StartsWith("/ssay "))
            {
                string[] args     = cmd.Split(' ');
                string   kickuser = "";
                for (int i = 1; i < args.Length; i++)
                {
                    kickuser += args[i];
                    if (i < args.Length)
                    {
                        kickuser += " ";
                    }
                }
                if (kickuser != "" && args.Length > 2)
                {
                    BoltGlobalEvent.SendMessage("<color=#CCCCCC>[<color=red>Server<color=#CCCCCC>] Says: " + kickuser, (Color32)Color.white);
                }
                else
                {
                    BoltGlobalEvent.SendPrivateMessage("/ssay <server message 2+ words long>", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                ev.Text = "";
            }
            //rl or reload
            if (cmd.StartsWith("/rl") || cmd.StartsWith("/reload"))
            {
                LoadConfig();
                try
                {
                    admins = ((IEnumerable <object>)Config["admins"]).OfType <string>().ToList();
                }
                catch (Exception e)
                {
                    Puts("Unable to load admins");
                    BoltGlobalEvent.SendPrivateMessage("Unable to load admins", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                try
                {
                    bans = ((IEnumerable <object>)Config["bans"]).OfType <string>().ToList();
                }
                catch (Exception e)
                {
                    Puts("Unable to load bans!");
                    BoltGlobalEvent.SendPrivateMessage("Unable to load bans!", new Color32(255, 0, 0, 255), ev.RaisedBy);
                    Debug.Log("Unable to load bans!");
                }
                try
                {
                    vipslots = (int)Config["vipslots"];
                }
                catch (Exception e)
                {
                    Puts("Unable to load vipslots");
                    BoltGlobalEvent.SendPrivateMessage("Unable to load vipslots", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                try
                {
                    vip = ((IEnumerable <object>)Config["vip"]).OfType <string>().ToList();
                }
                catch (Exception e)
                {
                    Puts("Unable to load vip");
                    BoltGlobalEvent.SendPrivateMessage("Unable to load vip", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                try
                {
                    spwnmsg = (string)Config["SpawnMessage"];
                }
                catch (Exception e)
                {
                    Puts("Unable to load spawnmsg");
                    BoltGlobalEvent.SendPrivateMessage("Unable to load spawnmsg", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                ev.Text = "";
            }
            //unban
            if (cmd.StartsWith("/unban "))
            {
                string[] args     = cmd.Split(' ');
                string   kickuser = "";
                for (int i = 1; i < args.Length; i++)
                {
                    kickuser += args[i];
                    if (i < args.Length - 1)
                    {
                        kickuser += " ";
                    }
                }
                if (kickuser != "" && bans.Contains(kickuser))
                {
                    bans.Remove(kickuser);
                    Config["bans"] = bans;
                    SaveConfig();
                    BoltGlobalEvent.SendMessage("<color=#CCCCCC>[<color=red>Server<color=#CCCCCC>] Unbanned: " + kickuser, (Color32)Color.white);
                }
                else
                {
                    BoltGlobalEvent.SendPrivateMessage("/unban <steam64id>", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                ev.Text = "";
            }
            //banid
            if (cmd.StartsWith("/banid "))
            {
                string[] args     = cmd.Split(' ');
                string   kickuser = "";
                for (int i = 1; i < args.Length; i++)
                {
                    kickuser += args[i];
                    if (i < args.Length - 1)
                    {
                        kickuser += " ";
                    }
                }
                if (kickuser != "")
                {
                    using (IEnumerator <BoltConnection> enumerator = BoltNetwork.connections.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            BoltConnection current = enumerator.Current;
                            if (current.GetPlayerConnection().PlayerInfo.state.SteamID.ToString() == kickuser)
                            {
                                bans.Add(kickuser);
                                Config["bans"] = bans;
                                SaveConfig();
                                BoltGlobalEvent.SendMessage("<color=#CCCCCC>[<color=red>Server<color=#CCCCCC>] Banned: " + current.GetPlayerConnection().PlayerInfo.state.PenName, (Color32)Color.white);
                                BoltConnection boltConnection = current;
                                RefuseToken    refuseToken1   = new RefuseToken();
                                refuseToken1.RefuseReason = "Banned by admin.";
                                RefuseToken refuseToken2 = refuseToken1;
                                boltConnection.Disconnect((IProtocolToken)refuseToken2);
                                break;
                            }
                        }
                    }
                }
                else
                {
                    BoltGlobalEvent.SendPrivateMessage("/kickid <steamid>", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                ev.Text = "";
            }
            //ban
            if (cmd.StartsWith("/ban "))
            {
                string[] args     = cmd.Split(' ');
                string   kickuser = "";
                for (int i = 1; i < args.Length; i++)
                {
                    kickuser += args[i];
                    if (i + 1 < args.Length)
                    {
                        kickuser += " ";
                    }
                }
                if (kickuser != "")
                {
                    using (IEnumerator <BoltConnection> enumerator = BoltNetwork.connections.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            BoltConnection current = enumerator.Current;
                            string         newname = current.GetPlayerConnection().PlayerInfo.state.PenName.Substring(9, current.GetPlayerConnection().PlayerInfo.state.PenName.Length - 19);
                            if (newname.ToLower().IndexOf(kickuser.ToLower()) != -1 && current.GetPlayerConnection().PlayerInfo.state.SteamID != user)
                            {
                                bans.Add(current.GetPlayerConnection().PlayerInfo.state.SteamID);
                                Config["bans"] = bans;
                                SaveConfig();
                                BoltGlobalEvent.SendMessage("<color=#CCCCCC>[<color=red>Server<color=#CCCCCC>] Banned: " + current.GetPlayerConnection().PlayerInfo.state.PenName, (Color32)Color.white);
                                BoltConnection boltConnection = current;
                                RefuseToken    refuseToken1   = new RefuseToken();
                                refuseToken1.RefuseReason = "Banned by admin.";
                                RefuseToken refuseToken2 = refuseToken1;
                                boltConnection.Disconnect((IProtocolToken)refuseToken2);
                                break;
                            }
                        }
                    }
                }
                else
                {
                    BoltGlobalEvent.SendPrivateMessage("/kick <username>", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                ev.Text = "";
            }
            //kickid
            if (cmd.StartsWith("/kickid "))
            {
                string[] args     = cmd.Split(' ');
                string   kickuser = "";
                for (int i = 1; i < args.Length; i++)
                {
                    kickuser += args[i];
                    if (i < args.Length)
                    {
                        kickuser += " ";
                    }
                }
                if (kickuser != "")
                {
                    using (IEnumerator <BoltConnection> enumerator = BoltNetwork.connections.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            BoltConnection current = enumerator.Current;
                            if (current.GetPlayerConnection().PlayerInfo.state.SteamID.ToString() == kickuser)
                            {
                                BoltGlobalEvent.SendMessage("<color=#CCCCCC>[<color=red>Server<color=#CCCCCC>] Kicked: " + current.GetPlayerConnection().PlayerInfo.state.PenName, (Color32)Color.white);
                                BoltConnection boltConnection = current;
                                RefuseToken    refuseToken1   = new RefuseToken();
                                refuseToken1.RefuseReason = "Kicked by admin.";
                                RefuseToken refuseToken2 = refuseToken1;
                                boltConnection.Disconnect((IProtocolToken)refuseToken2);
                                break;
                            }
                        }
                    }
                }
                else
                {
                    BoltGlobalEvent.SendPrivateMessage("/kickid <steamid>", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                ev.Text = "";
            }
            //kick
            if (cmd.StartsWith("/kick "))
            {
                string[] args     = cmd.Split(' ');
                string   kickuser = "";
                for (int i = 1; i < args.Length; i++)
                {
                    kickuser += args[i];
                    if (i + 1 < args.Length)
                    {
                        kickuser += " ";
                    }
                }
                if (kickuser != "")
                {
                    using (IEnumerator <BoltConnection> enumerator = BoltNetwork.connections.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            BoltConnection current = enumerator.Current;
                            string         newname = current.GetPlayerConnection().PlayerInfo.state.PenName.Substring(9, current.GetPlayerConnection().PlayerInfo.state.PenName.Length - 19);
                            if (newname.ToLower().IndexOf(kickuser.ToLower()) != -1 && current.GetPlayerConnection().PlayerInfo.state.SteamID != user)
                            {
                                BoltGlobalEvent.SendMessage("<color=#CCCCCC>[<color=red>Server<color=#CCCCCC>] Kicked: " + current.GetPlayerConnection().PlayerInfo.state.PenName, (Color32)Color.white);
                                BoltConnection boltConnection = current;
                                RefuseToken    refuseToken1   = new RefuseToken();
                                refuseToken1.RefuseReason = "Kicked by admin.";
                                RefuseToken refuseToken2 = refuseToken1;
                                boltConnection.Disconnect((IProtocolToken)refuseToken2);
                                break;
                            }
                        }
                    }
                }
                else
                {
                    BoltGlobalEvent.SendPrivateMessage("/kick <username>", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                ev.Text = "";
            }
            if (cmd.StartsWith("/"))
            {
                ev.Text = "";
            }
            return(true);
        }
Пример #2
0
        // chat commands:
        // /kick <username>
        // /kickid <steam64id>
        // /ssay <message to say as server>
        // /ban <>
        // /banid <>
        // /rl
        // /reload
        // unban <>
        object OnEvent(ChatEvent ev)
        {
            string user = ev.RaisedBy.GetPlayerConnection().SteamID.m_SteamID.ToString();

            if (bans.Contains(user))
            {
                BoltConnection boltConnection = ev.RaisedBy;
                RefuseToken    refuseToken1   = new RefuseToken();
                refuseToken1.RefuseReason = "Banned by admin.";
                RefuseToken refuseToken2 = refuseToken1;
                boltConnection.Disconnect((IProtocolToken)refuseToken2);
                return(true);
            }

            if (admins.IndexOf(user) == -1)
            {
                return(null);
            }
            string cmd = ev.Text;

            if (cmd.StartsWith("/"))
            {
                ev.Text = "";
            }
            else
            {
                return(null);
            }
            //ssay
            if (cmd.StartsWith("/ssay "))
            {
                string[] args     = cmd.Split(' ');
                string   kickuser = "";
                for (int i = 1; i < args.Length; i++)
                {
                    kickuser += args[i];
                    if (i < args.Length)
                    {
                        kickuser += " ";
                    }
                }
                if (kickuser != "" && args.Length > 2)
                {
                    BoltGlobalEvent.SendMessage("<color=#CCCCCC>[<color=red>Server<color=#CCCCCC>] Says: " + kickuser, (Color32)Color.white);
                }
                else
                {
                    BoltGlobalEvent.SendPrivateMessage("/ssay <server message 2+ words long>", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                ev.Text = "";
            }
            //rl or reload
            if (cmd.StartsWith("/rl") || cmd.StartsWith("/reload"))
            {
                LoadConfig();
                try
                {
                    admins = ((IEnumerable <object>)Config["admins"]).OfType <string>().ToList();
                }
                catch (Exception e)
                {
                    Puts("Unable to load admins");
                    BoltGlobalEvent.SendPrivateMessage("Unable to load admins", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                try
                {
                    bans = ((IEnumerable <object>)Config["bans"]).OfType <string>().ToList();
                }
                catch (Exception e)
                {
                    Puts("Unable to load bans!");
                    BoltGlobalEvent.SendPrivateMessage("Unable to load bans!", new Color32(255, 0, 0, 255), ev.RaisedBy);
                    Debug.Log("Unable to load bans!");
                }
                try
                {
                    vipslots = (int)Config["vipslots"];
                }
                catch (Exception e)
                {
                    Puts("Unable to load vipslots");
                    BoltGlobalEvent.SendPrivateMessage("Unable to load vipslots", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                try
                {
                    vip = ((IEnumerable <object>)Config["vip"]).OfType <string>().ToList();
                }
                catch (Exception e)
                {
                    Puts("Unable to load vip");
                    BoltGlobalEvent.SendPrivateMessage("Unable to load vip", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                try
                {
                    spwnmsg = (string)Config["SpawnMessage"];
                }
                catch (Exception e)
                {
                    Puts("Unable to load spawnmsg");
                    BoltGlobalEvent.SendPrivateMessage("Unable to load spawnmsg", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                ev.Text = "";
            }
            //unban
            if (cmd.StartsWith("/unban "))
            {
                string[] args     = cmd.Split(' ');
                string   kickuser = "";
                for (int i = 1; i < args.Length; i++)
                {
                    kickuser += args[i];
                    if (i < args.Length - 1)
                    {
                        kickuser += " ";
                    }
                }
                if (kickuser != "" && bans.Contains(kickuser))
                {
                    bans.Remove(kickuser);
                    Config["bans"] = bans;
                    SaveConfig();
                    BoltGlobalEvent.SendMessage("<color=#CCCCCC>[<color=red>Server<color=#CCCCCC>] Unbanned: " + kickuser, (Color32)Color.white);
                }
                else
                {
                    BoltGlobalEvent.SendPrivateMessage("/unban <steam64id>", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                ev.Text = "";
            }
            //banid
            if (cmd.StartsWith("/banid "))
            {
                string[] args     = cmd.Split(' ');
                string   kickuser = "";
                for (int i = 1; i < args.Length; i++)
                {
                    kickuser += args[i];
                    if (i < args.Length - 1)
                    {
                        kickuser += " ";
                    }
                }
                if (kickuser != "")
                {
                    using (IEnumerator <BoltConnection> enumerator = BoltNetwork.connections.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            BoltConnection current = enumerator.Current;
                            if (current.GetPlayerConnection().PlayerInfo.state.SteamID.ToString() == kickuser)
                            {
                                bans.Add(kickuser);
                                Config["bans"] = bans;
                                SaveConfig();
                                BoltGlobalEvent.SendMessage("<color=#CCCCCC>[<color=red>Server<color=#CCCCCC>] Banned: " + current.GetPlayerConnection().PlayerInfo.state.PenName, (Color32)Color.white);
                                BoltConnection boltConnection = current;
                                RefuseToken    refuseToken1   = new RefuseToken();
                                refuseToken1.RefuseReason = "Banned by admin.";
                                RefuseToken refuseToken2 = refuseToken1;
                                boltConnection.Disconnect((IProtocolToken)refuseToken2);
                                break;
                            }
                        }
                    }
                }
                else
                {
                    BoltGlobalEvent.SendPrivateMessage("/kickid <steamid>", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                ev.Text = "";
            }
            //ban
            if (cmd.StartsWith("/ban "))
            {
                string[] args     = cmd.Split(' ');
                string   kickuser = "";
                for (int i = 1; i < args.Length; i++)
                {
                    kickuser += args[i];
                    if (i + 1 < args.Length)
                    {
                        kickuser += " ";
                    }
                }
                if (kickuser != "")
                {
                    using (IEnumerator <BoltConnection> enumerator = BoltNetwork.connections.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            BoltConnection current = enumerator.Current;
                            string         newname = current.GetPlayerConnection().PlayerInfo.state.PenName.Substring(9, current.GetPlayerConnection().PlayerInfo.state.PenName.Length - 19);
                            if (newname.ToLower().IndexOf(kickuser.ToLower()) != -1 && current.GetPlayerConnection().PlayerInfo.state.SteamID != user)
                            {
                                bans.Add(current.GetPlayerConnection().PlayerInfo.state.SteamID);
                                Config["bans"] = bans;
                                SaveConfig();
                                BoltGlobalEvent.SendMessage("<color=#CCCCCC>[<color=red>Server<color=#CCCCCC>] Banned: " + current.GetPlayerConnection().PlayerInfo.state.PenName, (Color32)Color.white);
                                BoltConnection boltConnection = current;
                                RefuseToken    refuseToken1   = new RefuseToken();
                                refuseToken1.RefuseReason = "Banned by admin.";
                                RefuseToken refuseToken2 = refuseToken1;
                                boltConnection.Disconnect((IProtocolToken)refuseToken2);
                                break;
                            }
                        }
                    }
                }
                else
                {
                    BoltGlobalEvent.SendPrivateMessage("/kick <username>", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                ev.Text = "";
            }
            //kickid
            if (cmd.StartsWith("/kickid "))
            {
                string[] args     = cmd.Split(' ');
                string   kickuser = "";
                for (int i = 1; i < args.Length; i++)
                {
                    kickuser += args[i];
                    if (i < args.Length)
                    {
                        kickuser += " ";
                    }
                }
                if (kickuser != "")
                {
                    using (IEnumerator <BoltConnection> enumerator = BoltNetwork.connections.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            BoltConnection current = enumerator.Current;
                            if (current.GetPlayerConnection().PlayerInfo.state.SteamID.ToString() == kickuser)
                            {
                                BoltGlobalEvent.SendMessage("<color=#CCCCCC>[<color=red>Server<color=#CCCCCC>] Kicked: " + current.GetPlayerConnection().PlayerInfo.state.PenName, (Color32)Color.white);
                                BoltConnection boltConnection = current;
                                RefuseToken    refuseToken1   = new RefuseToken();
                                refuseToken1.RefuseReason = "Kicked by admin.";
                                RefuseToken refuseToken2 = refuseToken1;
                                boltConnection.Disconnect((IProtocolToken)refuseToken2);
                                break;
                            }
                        }
                    }
                }
                else
                {
                    BoltGlobalEvent.SendPrivateMessage("/kickid <steamid>", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                ev.Text = "";
            }
            //kick
            if (cmd.StartsWith("/kick "))
            {
                string[] args     = cmd.Split(' ');
                string   kickuser = "";
                for (int i = 1; i < args.Length; i++)
                {
                    kickuser += args[i];
                    if (i + 1 < args.Length)
                    {
                        kickuser += " ";
                    }
                }
                if (kickuser != "")
                {
                    using (IEnumerator <BoltConnection> enumerator = BoltNetwork.connections.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            BoltConnection current = enumerator.Current;
                            string         newname = current.GetPlayerConnection().PlayerInfo.state.PenName.Substring(9, current.GetPlayerConnection().PlayerInfo.state.PenName.Length - 19);
                            if (newname.ToLower().IndexOf(kickuser.ToLower()) != -1 && current.GetPlayerConnection().PlayerInfo.state.SteamID != user)
                            {
                                BoltGlobalEvent.SendMessage("<color=#CCCCCC>[<color=red>Server<color=#CCCCCC>] Kicked: " + current.GetPlayerConnection().PlayerInfo.state.PenName, (Color32)Color.white);
                                BoltConnection boltConnection = current;
                                RefuseToken    refuseToken1   = new RefuseToken();
                                refuseToken1.RefuseReason = "Kicked by admin.";
                                RefuseToken refuseToken2 = refuseToken1;
                                boltConnection.Disconnect((IProtocolToken)refuseToken2);
                                break;
                            }
                        }
                    }
                }
                else
                {
                    BoltGlobalEvent.SendPrivateMessage("/kick <username>", new Color32(255, 0, 0, 255), ev.RaisedBy);
                }
                ev.Text = "";
            }
            if (cmd.Equals("/speed"))
            {
                foreach (Scram.PlayerController playerController in UnityEngine.Object.FindObjectsOfType <Scram.PlayerController>())
                {
                    if (playerController.entity.controller != null && playerController.entity.controller.GetPlayerConnection().SteamID.m_SteamID.ToString() == user)
                    {
                        playerController.state.playerSpeedModifier = 3f;
                        BoltGlobalEvent.SendPrivateMessage("Speed set to 3", new Color32(255, 0, 255, 255), ev.RaisedBy);
                    }
                }
                ev.Text = "";
            }
            if (cmd.Equals("/clr"))
            {
                foreach (Scram.PlayerController playerController in UnityEngine.Object.FindObjectsOfType <Scram.PlayerController>())
                {
                    if (playerController.entity.controller != null && playerController.entity.controller.GetPlayerConnection().SteamID.m_SteamID.ToString() == user)
                    {
                        playerController.state.playerSpeedModifier = 1f;
                        playerController.state.playerScale         = 1f;
                        playerController.state.unlimitedAmmo       = false;
                        playerController.state.IsInvincible        = false;
                        BoltGlobalEvent.SendPrivateMessage("Cleared all modifiers", new Color32(255, 0, 255, 255), ev.RaisedBy);
                    }
                }
                ev.Text = "";
            }
            if (cmd.Equals("/big"))
            {
                foreach (Scram.PlayerController playerController in UnityEngine.Object.FindObjectsOfType <Scram.PlayerController>())
                {
                    if (playerController.entity.controller != null && playerController.entity.controller.GetPlayerConnection().SteamID.m_SteamID.ToString() == user)
                    {
                        playerController.state.playerScale = Mathf.Min(6f, playerController.state.playerScale + 0.1f);
                        BoltGlobalEvent.SendPrivateMessage("You are bigger", new Color32(255, 0, 255, 255), ev.RaisedBy);
                    }
                }
                ev.Text = "";
            }
            if (cmd.Equals("/small"))
            {
                foreach (Scram.PlayerController playerController in UnityEngine.Object.FindObjectsOfType <Scram.PlayerController>())
                {
                    if (playerController.entity.controller != null && playerController.entity.controller.GetPlayerConnection().SteamID.m_SteamID.ToString() == user)
                    {
                        playerController.state.playerScale = Mathf.Max(0.35f, playerController.state.playerScale - 0.1f);
                        BoltGlobalEvent.SendPrivateMessage("You are smaller", new Color32(255, 0, 255, 255), ev.RaisedBy);
                    }
                }
                ev.Text = "";
            }
            if (cmd.StartsWith("/size "))
            {
                foreach (Scram.PlayerController playerController in UnityEngine.Object.FindObjectsOfType <Scram.PlayerController>())
                {
                    if (playerController.entity.controller != null && playerController.entity.controller.GetPlayerConnection().SteamID.m_SteamID.ToString() == user)
                    {
                        string[] args = cmd.Split(' ');
                        if (args.Length == 2)
                        {
                            float number = 1;
                            float.TryParse(args[1], out number);
                            playerController.state.playerScale = number;
                            BoltGlobalEvent.SendPrivateMessage("Set size to " + number.ToString(), new Color32(255, 0, 255, 255), ev.RaisedBy);
                        }
                    }
                }
                ev.Text = "";
            }
            if (cmd.Equals("/ammo"))
            {
                foreach (Scram.PlayerController playerController in UnityEngine.Object.FindObjectsOfType <Scram.PlayerController>())
                {
                    if (playerController.entity.controller != null && playerController.entity.controller.GetPlayerConnection().SteamID.m_SteamID.ToString() == user)
                    {
                        playerController.state.unlimitedAmmo = !playerController.state.unlimitedAmmo;
                        BoltGlobalEvent.SendPrivateMessage("Unlimited ammo set to " + playerController.state.unlimitedAmmo, new Color32(255, 0, 255, 255), ev.RaisedBy);
                    }
                }
                ev.Text = "";
            }
            if (cmd.Equals("/god"))
            {
                foreach (Scram.PlayerController playerController in UnityEngine.Object.FindObjectsOfType <Scram.PlayerController>())
                {
                    if (playerController.entity.controller != null && playerController.entity.controller.GetPlayerConnection().SteamID.m_SteamID.ToString() == user)
                    {
                        playerController.state.IsInvincible = !playerController.state.IsInvincible;
                        BoltGlobalEvent.SendPrivateMessage("Invincibility set to " + playerController.state.IsInvincible, new Color32(255, 0, 255, 255), ev.RaisedBy);
                    }
                }
                ev.Text = "";
            }
            if (cmd.Equals("/slow"))
            {
                foreach (Scram.PlayerController playerController in UnityEngine.Object.FindObjectsOfType <Scram.PlayerController>())
                {
                    if (playerController.entity.controller != null && playerController.entity.controller.GetPlayerConnection().SteamID.m_SteamID.ToString() == user)
                    {
                        playerController.state.playerSpeedModifier = 1f;
                        BoltGlobalEvent.SendPrivateMessage("Speed set to 1", new Color32(255, 0, 255, 255), ev.RaisedBy);
                    }
                }
                ev.Text = "";
            }
            if (cmd.StartsWith("/"))
            {
                ev.Text = "";
            }
            return(true);
        }