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 muté."; }
- }
- public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
- {
- if (Params.Length == 1)
- {
- Session.SendWhisper("Entrez le nom de l'utilisateur que vous souhaitez unmute.");
- return;
- }
- GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
- if (TargetClient == null || TargetClient.GetHabbo() == null)
- {
- Session.SendWhisper("Une erreur s'est produite lors de la recherche de cet utilisateur, il est peut-être hors-ligne.");
- return;
- }
- using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
- {
- dbClient.RunQuery("UPDATE `users` SET `time_muted` = '0' WHERE `id` = '" + TargetClient.GetHabbo().Id + "' LIMIT 1");
- }
- TargetClient.GetHabbo().TimeMuted = 0;
- TargetClient.SendNotification("Tu as été démuté par " + Session.GetHabbo().Username + "!");
- Session.SendWhisper("Tu as bien démuté " + TargetClient.GetHabbo().Username + "!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement