Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Text;
- using System.Collections.Generic;
- using Plus.Database.Interfaces;
- using Plus.Utilities;
- using Plus.HabboHotel.GameClients;
- namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator
- {
- class UnmuteCommand : IChatCommand
- {
- public string PermissionRequired
- {
- get { return "command_unmute"; }
- }
- public string Parameters
- {
- get { return "%username%"; }
- }
- public string Description
- {
- get { return "Réactiver un utilisateur actuellement mis en sourdine."; }
- }
- public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
- {
- if (Params.Length == 1)
- {
- Session.SendWhisper("S'il vous plaît entrez le nom de l'utilisateur que vous souhaitez désactiver.");
- return;
- }
- GameClient TargetClient = HobbawEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
- if (TargetClient == null || TargetClient.GetHabbo() == null)
- {
- Session.SendWhisper("Une erreur est survenue tout en trouvant l'utilisateur, peut-être qu'ils ne sont pas en ligne.");
- return;
- }
- using (IQueryAdapter dbClient = HobbawEnvironment.GetDatabaseManager().GetQueryReactor())
- {
- dbClient.RunQuery("UPDATE `users` SET `time_muted` = '0' WHERE `id` = '" + TargetClient.GetHabbo().Id + "' LIMIT 1");
- }
- TargetClient.GetHabbo().TimeMuted = 0;
- TargetClient.SendNotification("Vous avez été démuté par " + Session.GetHabbo().Username + "!");
- Session.SendWhisper("Le joueur " + TargetClient.GetHabbo().Username + " a été démuté avec succès!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement