Ejemplo n.º 1
0
 public void SetAdmin(bool isAdmin, UnturnedPlayer issuer)
 {
     if (isAdmin)
     {
         SteamAdminlist.admin(CSteamID, issuer?.CSteamID ?? new CSteamID(0));
     }
     else
     {
         SteamAdminlist.unadmin(NativePlayer.channel.owner.playerID.steamID);
     }
 }
Ejemplo n.º 2
0
 public void Admin(bool admin, UnturnedPlayer issuer)
 {
     if (admin)
     {
         if (issuer == null)
         {
             SteamAdminlist.admin(this.CSteamID, new CSteamID(0));
         }
         else
         {
             SteamAdminlist.admin(this.CSteamID, issuer.CSteamID);
         }
     }
     else
     {
         SteamAdminlist.unadmin(player.SteamChannel.SteamPlayer.SteamPlayerID.CSteamID);
     }
 }
Ejemplo n.º 3
0
        public override void Execute(PointBlankPlayer executor, string[] args)
        {
            if (!PlayerTool.tryGetSteamID(args[0], out CSteamID player))
            {
                UnturnedChat.SendMessage(executor, Translations["Base_InvalidPlayer"], ConsoleColor.Red);
                return;
            }

            if (executor == null)
            {
                SteamAdminlist.admin(player, CSteamID.Nil);
                CommandWindow.Log(string.Format(Translations["Admin_Set"], player), ConsoleColor.Green);
            }
            else
            {
                SteamAdminlist.admin(player, (PointBlankPlayer.IsServer(executor) ? CSteamID.Nil : ((UnturnedPlayer)executor).SteamID));
                executor.SendMessage(string.Format(Translations["Admin_Set"], player), Color.green);
            }
        }