mazerunner
New Member
- May 3, 2017
- 5
- 0
how do i update commands and stuffs with text
how do i make a command like hugs
Hug Command
using System;
using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.GameClients;
using Plus.Communication.Packets.Outgoing.Rooms.Chat;
namespace Plus.HabboHotel.Rooms.Chat.Commands.User.Fun
{
class Hug : IChatCommand
{
public string PermissionRequired
{
get { return "command_hug"; }
}
public string Parameters
{
get { return "%username%"; }
}
public string Description
{
get { return "Hug another user"; }
}
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 = PlusEnvironment.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 ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (ThisUser == null)
return;
if (!((Math.Abs(User.X - ThisUser.X) >= 2 && (Math.Abs(User.Y - ThisUser.Y) >= 2))))
{
Room.SendMessage(new ChatComposer(ThisUser.VirtualId, "*Hugs " + TargetClient.GetHabbo().Username + "*", 0, User.LastBubble));
User.ApplyEffect(9);
}
else
{
Session.SendWhisper("That user is too far away, try getting closer.");
return;
}
}
}
}