CheckChangePermissions() private method

private CheckChangePermissions ( Player p ) : bool
p Player
return bool
Ejemplo n.º 1
0
        private static void OnStop(Player p, Command cmd)
        {
            LifeHandler handler = GetCheckedLifeHandler(p, cmd);

            if (null == handler)
            {
                return;
            }
            if (!handler.CheckChangePermissions(p))
            {
                return;
            }
            handler._life.Stop();
            p.Message("&yLife " + handler._life.Name + " is stopped");
        }
Ejemplo n.º 2
0
        private static void OnSet(Player p, Command cmd)
        {
            LifeHandler handler = GetCheckedLifeHandler(p, cmd);

            if (null == handler)
            {
                return;
            }
            if (!handler.CheckChangePermissions(p))
            {
                return;
            }

            string paramStr = cmd.Next();

            if (string.IsNullOrWhiteSpace(paramStr))
            {
                p.Message("&WEmpty parameter name. &hAccepted names are " + _allParams.ToString());
                return;
            }
            Param param;

            if (!_params.TryGetValue(paramStr, out param))
            {
                p.Message("&WUknown parameter name" + paramStr + ". &hAccepted names are " + _allParams.ToString());
                return;
            }
            string val = cmd.Next();

            if (string.IsNullOrWhiteSpace(val))
            {
                p.Message("&WEmpty value.");
                return;
            }
            param.SetValue(p, handler._life, val);
        }