コード例 #1
0
    public static void PacketWeapons(Player player)
    {
        if (player.ListGuns.Count == 0)
        {
            player.SendClientMessage(Color.Red, "Error: No tienes ningún elemento en tu paquete de armas.");
            return;
        }
        var packet = new TablistDialog("Packet Weapons", 1, "Eliminar", "Cerrar");

        foreach (Gun gun in player.ListGuns)
        {
            packet.Add(gun.Weapon.ToString());
        }
        packet.Show(player);
        packet.Response += (sender, e) =>
        {
            if (e.DialogButton == DialogButton.Left)
            {
                player.SendClientMessage(Color.Red, $"[Weapon]: {Color.Yellow}{player.ListGuns[e.ListItem].Weapon} se eliminó de tu paquete de armas.");
                player.RemoveWeapon(e.ListItem);
                packet.Clear();
                foreach (Gun gun in player.ListGuns)
                {
                    packet.Add(gun.Weapon.ToString());
                }
                packet.Show(player);
            }
        };
    }
コード例 #2
0
 public static void SetInfo(this TablistDialog vs)
 {
     vs.Clear();
     TeamAlpha.GetMessageTeamEnable(out var msgAlpha, false);
     TeamBeta.GetMessageTeamEnable(out var msgBeta, false);
     vs.Add(new[]
     {
         $"{TeamAlpha.OtherColor}{TeamAlpha.NameTeam}",
         $"{TeamAlpha.OtherColor}{TeamAlpha.Members}",
         $"{TeamAlpha.OtherColor}{msgAlpha}"
     });
     vs.Add(new[]
     {
         $"{TeamBeta.OtherColor}{TeamBeta.NameTeam}",
         $"{TeamBeta.OtherColor}{TeamBeta.Members}",
         $"{TeamBeta.OtherColor}{msgBeta}"
     });
 }