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="Banana" data-source="post: 432028" data-attributes="member: 79737"><p>There is no error, here is the code i use:</p><p></p><p>[CODE]using System;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.Collections.Generic;</p><p></p><p>using Plus.HabboHotel.GameClients;</p><p></p><p>namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator</p><p>{</p><p> class RemoveBadgeCommand : IChatCommand</p><p> {</p><p> public string PermissionRequired</p><p> {</p><p> get { return "command_remove_badge"; }</p><p> }</p><p></p><p> public string Parameters</p><p> {</p><p> get { return "%username% %badge%"; }</p><p> }</p><p></p><p> public string Description</p><p> {</p><p> get { return "Remove a badge from a player"; }</p><p> }</p><p></p><p> public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)</p><p> {</p><p> if (Params.Length != 3)</p><p> {</p><p> Session.SendWhisper("Please enter a username and the code of the badge you want to remove!");</p><p> return;</p><p> }</p><p></p><p> GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);</p><p> if (TargetClient != null)</p><p> {</p><p> if (!TargetClient.GetHabbo().GetBadgeComponent().HasBadge(Params[2]))</p><p> {</p><p> TargetClient.GetHabbo().GetBadgeComponent().RemoveBadge(Params[2]);</p><p> if (TargetClient.GetHabbo().Id != Session.GetHabbo().Id)</p><p> TargetClient.SendNotification("You have had the badge " + Params[2] + " removed from you!");</p><p> else</p><p> Session.SendWhisper("You have succesfully removed the badge " + Params[2] + " from yourself!");</p><p> }</p><p> else</p><p> Session.SendWhisper("Oops, that user does not have that badge!");</p><p> return;</p><p> }</p><p> else</p><p> {</p><p> Session.SendWhisper("That user cannot be found!");</p><p> return;</p><p> }</p><p> }</p><p> }</p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="Banana, post: 432028, member: 79737"] There is no error, here is the code i use: [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; } } } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
RemoveBadge does not work
Top