Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
RemoveBadge does not work
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="AssLikeThat" data-source="post: 432044" data-attributes="member: 27476"><p>Try mine, works fine.</p><p></p><p>[CODE]using System;</p><p></p><p>using System.Linq;</p><p></p><p>using System.Text;</p><p></p><p>using System.Collections.Generic;</p><p></p><p>using Plus.HabboHotel.Rooms.Chat.Commands;</p><p></p><p>using Plus.HabboHotel.GameClients;</p><p></p><p>using Plus.Communication.Packets.Outgoing.Inventory.Badges;</p><p></p><p></p><p></p><p></p><p></p><p>namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator</p><p></p><p>{</p><p></p><p> class TakeBadgeCommand : IChatCommand</p><p></p><p> {</p><p></p><p> public string PermissionRequired</p><p></p><p> {</p><p></p><p> get { return "command_takebadge"; }</p><p></p><p> }</p><p></p><p></p><p></p><p> public string Parameters</p><p></p><p> {</p><p></p><p> get { return "%username% %badge%"; }</p><p></p><p> }</p><p></p><p></p><p></p><p> public string Description</p><p></p><p> {</p><p></p><p> get { return "Take a badge from a user."; }</p><p></p><p> }</p><p></p><p></p><p></p><p> public void Execute(GameClient Session, Room Room, string[] Params)</p><p></p><p> {</p><p></p><p> if (Params.Length != 3)</p><p></p><p> {</p><p></p><p> Session.SendWhisper("Please enter a username and the code of the badge you'd like to take!");</p><p></p><p> return;</p><p></p><p> }</p><p></p><p></p><p></p><p> GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);</p><p></p><p> if (TargetClient != null)</p><p></p><p> {</p><p></p><p> if (TargetClient.GetHabbo().GetBadgeComponent().HasBadge(Params[2]))</p><p></p><p> {</p><p></p><p> TargetClient.GetHabbo().GetBadgeComponent().RemoveBadge(Params[2]);</p><p></p><p> if (TargetClient.GetHabbo().Id != Session.GetHabbo().Id)</p><p></p><p> {</p><p></p><p> TargetClient.SendPacket(new BadgesComposer(Session));</p><p></p><p> TargetClient.SendNotification(Session.GetHabbo().Username + " has removed the badge " + Params[2] + " from you!");</p><p></p><p> }</p><p></p><p> else</p><p></p><p> {</p><p></p><p> Session.SendWhisper("You have successfully removed the badge " + Params[2] + " from yourself!");</p><p></p><p> TargetClient.SendPacket(new BadgesComposer(TargetClient));</p><p></p><p> }</p><p></p><p> }</p><p></p><p> else</p><p></p><p> Session.SendWhisper("Oops, that user doesn't have this badge (" + Params[2] + ") !");</p><p></p><p> return;</p><p></p><p> }</p><p></p><p> else</p><p></p><p> {</p><p></p><p> Session.SendWhisper("Oops, we couldn't find that target user!");</p><p></p><p> return;</p><p></p><p> }</p><p></p><p> }</p><p></p><p> }</p><p></p><p>}[/CODE]</p><p></p><p>EDIT: Actually looking at that, it's basically the same..</p><p></p><p>Make sure command_remove_badge is added into your permissions_commands</p></blockquote><p></p>
[QUOTE="AssLikeThat, post: 432044, member: 27476"] Try mine, works fine. [CODE]using System; using System.Linq; using System.Text; using System.Collections.Generic; using Plus.HabboHotel.Rooms.Chat.Commands; 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_takebadge"; } } public string Parameters { get { return "%username% %badge%"; } } public string Description { get { return "Take a badge from a user."; } } 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.SendPacket(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.SendPacket(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; } } } }[/CODE] EDIT: Actually looking at that, it's basically the same.. Make sure command_remove_badge is added into your permissions_commands [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
RemoveBadge does not work
Top