Example #1
0
        public static void SetPermission(this Smod2.API.Player self, string color, string badge, double permission, bool cover, bool hidden, bool isStaff = false)
        {
            GameObject  player        = (GameObject)self.GetGameObject();
            ServerRoles ComponentRole = player.GetComponent <ServerRoles>();
            UserGroup   group         = new UserGroup();

            group.BadgeColor      = color;
            group.BadgeText       = badge;
            group.Permissions     = (ulong)permission;
            group.Cover           = cover;
            group.HiddenByDefault = hidden;
            ComponentRole.SetGroup(group, false, false, false);
            if (isStaff)
            {
                ComponentRole.Staff = true;
            }
        }
Example #2
0
        public static int GetMaxHP(this Smod2.API.Player self, int maxhp)
        {
            GameObject player = (GameObject)self.GetGameObject();

            return(player.GetComponent <PlayerStats>().maxHP);
        }
Example #3
0
        public static void SetOverwatch(this Smod2.API.Player self, bool overwatch)
        {
            GameObject player = (GameObject)self.GetGameObject();

            player.GetComponent <ServerRoles>().CmdSetOverwatchStatus(overwatch);
        }
Example #4
0
        public static void SetMute(this Smod2.API.Player self, bool mute)
        {
            GameObject player = (GameObject)self.GetGameObject();

            player.GetComponent <CharacterClassManager>().SetMuted(mute);
        }