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!"));
}
}
}
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;
}
}
}
}
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; } } } }
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; } } } }
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?