:takebadge PlusEMU

Status
Not open for further replies.

Calle787

New Member
Nov 30, 2015
17
3
Hello!

I really need a takebadge command for my retro, since its so hard to get into the db remove right badges ect, so if anyone got a code on this command and can share it with me it would be so nice! If not you maybe can send me to a link where I can find a code or so!

//Thanks in before Calle
 

Damien

Don't need glasses if you can C#
Feb 26, 2012
429
642
If you're not going to help, why bother commenting on the thread?

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

using Plus.HabboHotel.GameClients;
using Plus.Communication.Packets.Outgoing.Inventory.Badges;

namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator
{
    class TakeBadgeCommand : IChatCommand
    {
        public string PermissionRequired
        {
            get { return "command_take_badge"; }
        }
     
        public void Execute(GameClient Session, Room Room, string[] Params)
        {
            if (Params.Length != 3)
            {
                Session.SendWhisper("Please enter a username and the code of the badge you'd like to take!");
                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.SendMessage(new BadgesComposer(Session));
                        TargetClient.SendNotification(Session.GetHabbo().Username + " has removed the badge " + Params[2] + " from you!");
                    else
                        Session.SendWhisper("You have successfully removed the badge " + Params[2] + " from yourself!");
                    TargetClient.SendMessage(new BadgesComposer(TargetClient));
                }
                else
                    Session.SendWhisper("Oops, that user doesn't have this badge (" + Params[2] + ") !");
                return;
            }
            else
            {
                Session.SendWhisper("Oops, we couldn't find that target user!");
                return;
            }
        }
    }
}


Also make sure the class name in GiveBadgeCommand.cs is "GiveBadgeCommand". For whatever reason mine was set to "TakeBadgeCommand"
 
Status
Not open for further replies.

Users who are viewing this thread

Top