Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Plus.Database.Interfaces;
- using Plus.Utilities;
- using Plus.HabboHotel.Users;
- using Plus.HabboHotel.GameClients;
- using Plus.Core;
- using Plus.Communication.Packets.Incoming;
- using Plus.HabboHotel.Rooms;
- using Plus.HabboHotel.Quests;
- using Plus.Communication.Packets.Outgoing.Rooms.Engine;
- namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator
- {
- class DelMottoCommand : IChatCommand
- {
- public string PermissionRequired
- {
- get { return "command_delmotto"; }
- }
- public string Parameters
- {
- get { return "%username%"; }
- }
- public string Description
- {
- get { return "Change a motto that is against the rules."; }
- }
- public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
- {
- Habbo Habbo = PlusEnvironment.GetHabboByUsername(Params[1]);
- if (Habbo == null)
- {
- Session.SendWhisper("Couldn't find user in database.");
- return;
- }
- if (Habbo.GetPermissions().HasRight("mod_tool"))
- {
- Session.SendWhisper("Oops, you cannot change that user's motto.");
- return;
- }
- using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
- {
- dbClient.SetQuery("UPDATE `users` SET `motto` = 'Motto is against the Habbo Rules' WHERE `id` = '" + Habbo.Id + "' LIMIT 1");
- dbClient.RunQuery();
- }
- if (Habbo.GetClient() != null)
- {
- Habbo.GetClient().SendNotification("Your motto has been deleted by a moderator.");
- }
- Session.SendWhisper("You succesfully deleted " + Habbo.Username + "'s motto ");
- RoomUser User = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]); // Hier zit de fout.
- Room.SendMessage(new UserChangeComposer(User, false));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement