Example #1
0
        bool Execute(string name)
        {
            CVarCommand cmd = CRegistery.FindCvarCommand(name);

            if (cmd == null)
            {
                PrintError("Can't find cvar: '{0}'", name);
                return(false);
            }

            cmd.ParentCommand = this;
            cmd.SetDefault();
            cmd.ParentCommand = null;

            return(true);
        }
Example #2
0
        bool Execute(string cvarName)
        {
            CVarCommand cmd = CRegistery.FindCvarCommand(cvarName);

            if (cmd == null)
            {
                PrintError("Can't find cvar '" + cvarName + "'");
                return(false);
            }

            if (!cmd.IsInt)
            {
                PrintError("Can't toggle non-int value");
                return(false);
            }

            cmd.ParentCommand = this;
            cmd.SetValue(cmd.BoolValue ? 0 : 1);
            cmd.ParentCommand = null;

            return(true);
        }