コード例 #1
0
ファイル: ToggleTag.cs プロジェクト: KarlOfDuty/ToggleTag
        public string[] OnCall(ICommandSender sender, string[] args)
        {
            // Check if userid is included
            if (args.Length > 0)
            {
                // Check if already visible
                if (plugin.tagsToggled.Remove(args[0]))
                {
                    // Gets the player name for the feedback and sets the playeer's tag status if they are online
                    string           name   = "";
                    Smod2.API.Player player = plugin.Server.GetPlayers(args[0])?[0];
                    if (player != null)
                    {
                        player.HideTag(false);
                        name = player.Name;
                    }
                    else
                    {
                        name = "offline player";
                    }

                    plugin.SaveTagsToFile();
                    return(new[] { "Tag revealed of " + name + "." });
                }
                else
                {
                    // Still set the tag just in case it's status is not synced with the plugin's status for some reason
                    Smod2.API.Player player = plugin.Server.GetPlayers(args[0])?[0];
                    player?.HideTag(false);
                    return(new[] { "Tag was already revealed." });
                }
            }
            return(new[] { "Not enough arguments provided. 'console_showtag <userid>'" });
        }
コード例 #2
0
 public game_Player(Smod2.API.Player Player, bool assigned_to = false)
 {
     this.Player      = Player;
     this.assigned_to = assigned_to;
 }