WanknessHD
Hardcore Habboer
- Jun 13, 2011
- 48
- 5
I have a simple kiss command and it is supposed to output a message of you kissing the user, but in-game it is not showing the message.
I compared it to a hug command that outputs the same message and it shows, but I don't know why this isn't.
Also when I try to kiss someone that isn't in the room, it just blows a kiss and puts hearts around me without telling me that they're not in the room.
Code:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.Pathfinding;
using Plus.HabboHotel.GameClients;
using Plus.Communication.Packets.Outgoing.Rooms.Chat;
namespace Plus.HabboHotel.Rooms.Chat.Commands.User
{
class KissCommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_rp"; }
}
public string Parameters
{
get { return "%name%"; }
}
public string Description
{
get { return "Kiss a user"; }
}
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Choose a user");
return;
}
if (!Room.PushEnabled && !Session.GetHabbo().GetPermissions().HasRight("room_override_custom_config"))
{
Session.SendWhisper("Room owner disabled kissing.");
return;
}
GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
if (TargetClient == null)
{
Session.SendWhisper("User doesnt exist!");
return;
}
RoomUser TargetUser = Room.GetRoomUserManager().GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
if (TargetUser == null)
{
Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online or in this room.");
return;
}
if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
{
Session.SendWhisper("You cant kiss yourself!");
return;
}
if (TargetUser.TeleportEnabled)
{
Session.SendWhisper("Oops, this person disabled kisses!");
return;
}
RoomUser ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (ThisUser == null)
return;
if (!((Math.Abs(TargetUser.X - ThisUser.X) >= 2) || (Math.Abs(TargetUser.Y - ThisUser.Y) >= 2)))
{
ThisUser.ApplyEffect(9);
TargetUser.ApplyEffect(9);
Room.SendMessage(new ChatComposer(ThisUser.VirtualId, "* Kisses " + Params[1] + " *", 1, ThisUser.LastBubble));
Room.SendMessage(new ChatComposer(TargetUser.VirtualId, "* Getting kisses by " + Session.GetHabbo().Username + " *", 1, ThisUser.LastBubble));
ThisUser.ApplyEffect(0);
TargetUser.ApplyEffect(0);
}
else
{
Session.SendWhisper("Oops, " + Params[1] + " isnt close enough!");
}
}
}
}
I compared it to a hug command that outputs the same message and it shows, but I don't know why this isn't.
Also when I try to kiss someone that isn't in the room, it just blows a kiss and puts hearts around me without telling me that they're not in the room.