Command RemoveBadge

Alezo

Member
Dec 18, 2016
90
10
Hello, can someone pass me the .cs file of the command that removes character badges? Please.

Thank you
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
What do you mean command that removes character badges? Like you can take away a badge from a user? Or the command that disables the badge above the users head?
 

Core

Member
Nov 10, 2016
356
138
Here is the forced effects (the staff badges above the users head, etc).

Code:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Plus.Database.Interfaces;


namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator
{
    class DisableForcedFXCommand : IChatCommand
    {
        public string PermissionRequired
        {
            get { return "command_forced_effects"; }
        }

        public string Parameters
        {
            get { return ""; }
        }

        public string Description
        {
            get { return "Gives you the ability to ignore or allow forced effects."; }
        }

        public void Execute(GameClients.GameClient Session, Room Room, string[] Params)
        {
            Session.GetHabbo().DisableForcedEffects = !Session.GetHabbo().DisableForcedEffects;
            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("UPDATE `users` SET `disable_forced_effects` = @DisableForcedEffects WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
                dbClient.AddParameter("DisableForcedEffects", (Session.GetHabbo().DisableForcedEffects == true ? 1 : 0).ToString());
                dbClient.RunQuery();
            }

            Session.SendWhisper("Forced FX mode is now " + (Session.GetHabbo().DisableForcedEffects == true ? "disabled!" : "enabled!"));
        }
    }
}
 
May 1, 2015
467
152
If you're looking for the command to remove badges from players, i've coded it for you:

Code:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;

using Plus.HabboHotel.GameClients;

namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator
{
    class RemoveBadgeCommand : IChatCommand
    {
        public string PermissionRequired
        {
            get { return "command_remove_badge"; }
        }

        public string Parameters
        {
            get { return "%username% %badge%"; }
        }

        public string Description
        {
            get { return "Remove a badge from a player"; }
        }

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Params.Length != 3)
            {
                Session.SendWhisper("Please enter a username and the code of the badge you want to remove!");
                return;
            }

            GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
            if (TargetClient != null)
            {
                if (!TargetClient.GetHabbo().GetBadgeComponent().HasBadge(Params[2]))
                {
                    TargetClient.GetHabbo().GetBadgeComponent().RemoveBadge(Params[2]);
                    if (TargetClient.GetHabbo().Id != Session.GetHabbo().Id)
                        TargetClient.SendNotification("You have had the badge " + Params[2] + " removed from you!");
                    else
                        Session.SendWhisper("You have succesfully removed the badge  " + Params[2] + " from yourself!");
                }
                else
                    Session.SendWhisper("Oops, that user does not have that badge!");
                return;
            }
            else
            {
                Session.SendWhisper("That user cannot be found!");
                return;
            }
        }
    }
}
 

WanknessHD

Hardcore Habboer
Jun 13, 2011
48
5
If you're looking for the command to remove badges from players, i've coded it for you:

Code:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;

using Plus.HabboHotel.GameClients;

namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator
{
    class RemoveBadgeCommand : IChatCommand
    {
        public string PermissionRequired
        {
            get { return "command_remove_badge"; }
        }

        public string Parameters
        {
            get { return "%username% %badge%"; }
        }

        public string Description
        {
            get { return "Remove a badge from a player"; }
        }

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Params.Length != 3)
            {
                Session.SendWhisper("Please enter a username and the code of the badge you want to remove!");
                return;
            }

            GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
            if (TargetClient != null)
            {
                if (!TargetClient.GetHabbo().GetBadgeComponent().HasBadge(Params[2]))
                {
                    TargetClient.GetHabbo().GetBadgeComponent().RemoveBadge(Params[2]);
                    if (TargetClient.GetHabbo().Id != Session.GetHabbo().Id)
                        TargetClient.SendNotification("You have had the badge " + Params[2] + " removed from you!");
                    else
                        Session.SendWhisper("You have succesfully removed the badge  " + Params[2] + " from yourself!");
                }
                else
                    Session.SendWhisper("Oops, that user does not have that badge!");
                return;
            }
            else
            {
                Session.SendWhisper("That user cannot be found!");
                return;
            }
        }
    }
}

Thank you for this, great work.
 

Alezo

Member
Dec 18, 2016
90
10
If you're looking for the command to remove badges from players, i've coded it for you:

Code:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;

using Plus.HabboHotel.GameClients;

namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator
{
    class RemoveBadgeCommand : IChatCommand
    {
        public string PermissionRequired
        {
            get { return "command_remove_badge"; }
        }

        public string Parameters
        {
            get { return "%username% %badge%"; }
        }

        public string Description
        {
            get { return "Remove a badge from a player"; }
        }

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Params.Length != 3)
            {
                Session.SendWhisper("Please enter a username and the code of the badge you want to remove!");
                return;
            }

            GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
            if (TargetClient != null)
            {
                if (!TargetClient.GetHabbo().GetBadgeComponent().HasBadge(Params[2]))
                {
                    TargetClient.GetHabbo().GetBadgeComponent().RemoveBadge(Params[2]);
                    if (TargetClient.GetHabbo().Id != Session.GetHabbo().Id)
                        TargetClient.SendNotification("You have had the badge " + Params[2] + " removed from you!");
                    else
                        Session.SendWhisper("You have succesfully removed the badge  " + Params[2] + " from yourself!");
                }
                else
                    Session.SendWhisper("Oops, that user does not have that badge!");
                return;
            }
            else
            {
                Session.SendWhisper("That user cannot be found!");
                return;
            }
        }
    }
}

Thanks, man. Anyway, I appreciate it. The command does not work, I added the command in visual studio, and put in thecommandmanager.cs. But still, the emblem is not removed
 
What do you mean command that removes character badges? Like you can take away a badge from a user? Or the command that disables the badge above the users head?


The command, and to remove an emblem of a particular user.
 

Users who are viewing this thread

Top