ItsMods

Full Version: [Help] How to hide a command?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to hide a command in chat !admin?

PHP Code:
using Addon;
    
using System;
    
using System.Collections;
    
using System.Collections.Generic;

    public class 
ShowAdmins CPlugin
    
{
        private 
ArrayList Admins_Xuids = new ArrayList();

        public 
override ChatType OnSay(string MessageServerClient Client)
        {
            try
            {
                if (
Message.StartsWith("!admin"))
                {
                    
string str "";
                    List<
ServerClientclients base.GetClients();
                    if (
clients != null)
                    {
                        
bool flag true;
                        
int num 0;
                        foreach (
ServerClient client in clients)
                        {
                            if (
this.Admins_Xuids.Contains(client.XUID))
                            {
                                if (
flag)
                                {
                                    
str str client.Name;
                                    
flag false;
                                }
                                else
                                {
                                    
str str ", " client.Name;
                                }
                                
num++;
                            }
                        } 
Code:
if(message == "!admin")
{


// END HERE
return ChatType.ChatReturn; // or ChatNone
}
Does not work, switches off completely all chat
Also you should add return chatype in catch.
Strange, it should work.
Thanks, all works!