Пример #1
0
        public static bool HandleClientCommand(string commandName, int entity)
        {
            string[] args = new string[GameInterface.Cmd_Argc_sv()];

            for (int i = 0; i < args.Length; i++)
            {
                args[i] = GameInterface.Cmd_Argv_sv(i);
            }

            Entity entObj  = Entity.GetEntity(entity);
            bool   handled = false;

            ScriptProcessor.RunAll(script =>
            {
                handled = script.OnClientCommand(entObj, commandName.ToLowerInvariant(), args);
            });

            return(handled);
        }
Пример #2
0
        public static bool HandleClientCommand(string commandName, int entity)
        {
            var args = new string[GameInterface.Cmd_Argc_sv()];

            for (var i = 0; i < args.Length; i++)
            {
                args[i] = GameInterface.Cmd_Argv_sv(i);
            }

            var entObj  = Entity.GetEntity(entity);
            var handled = false;

            ScriptProcessor.RunAll(script =>
            {
                var success = script.ProcessClientCommand(commandName.ToLowerInvariant(), entObj, args);
                if (success)
                {
                    handled = true;
                }
            });

            return(handled);
        }