Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Quasar.HabboHotel.GameClients;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Quasar.HabboHotel.Rooms.Chat.Commands.Gebruiker
- {
- class WelcomeCommand : IChatCommand
- {
- public string PermissionRequired
- {
- get { return "command_welcome"; }
- }
- public string Parameters
- {
- get { return "%username%"; }
- }
- public string Description
- {
- get { return "Welcome another user to the hotel!"; }
- }
- public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
- {
- if (Params.Length == 1)
- {
- Session.SendWhisper("You must enter a username!");
- return;
- }
- GameClient TargetClient = QuasarEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
- if (TargetClient == null)
- {
- Session.SendWhisper("That user cannot be found, maybe they're offline or not in the room.");
- return;
- }
- RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
- if (User == null)
- {
- Session.SendWhisper("The user cannot be found, maybe they're offline or not in the room.");
- return;
- }
- RoomUser Self = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
- if (User == Self)
- {
- Session.SendWhisper("You can't welcome yourself!");
- return;
- }
- RoomUser ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
- if (ThisUser == null)
- return;
- if (Session.GetHabbo().CurrentRoomId == TargetClient.GetHabbo().CurrentRoomId)
- {
- Session.SendMessage("Welcome to Habwave " + TargetClient.GetHabbo().Username + "! We hope you enjoy your stay!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement