Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Boon Emulator Issues! + Custom Commands
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Joshhh" data-source="post: 377346" data-attributes="member: 67621"><p>[CODE]using System;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.Collections.Generic;</p><p></p><p>using Plus.HabboHotel.Rooms;</p><p>using Plus.HabboHotel.Pathfinding;</p><p>using Plus.HabboHotel.GameClients;</p><p>using Plus.Communication.Packets.Outgoing.Rooms.Chat;</p><p></p><p>namespace Plus.HabboHotel.Rooms.Chat.Commands.User.Fun</p><p>{</p><p> class KissCommand : IChatCommand</p><p> {</p><p> public string PermissionRequired</p><p> {</p><p> get { return "command_kiss"; }</p><p> }</p><p></p><p> public string Parameters</p><p> {</p><p> get { return "%target%"; }</p><p> }</p><p></p><p> public string Description</p><p> {</p><p> get { return "Give another user a kiss."; }</p><p> }</p><p></p><p> public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)</p><p> {</p><p> if (Params.Length == 1)</p><p> {</p><p> Session.SendWhisper("Please enter the username of the user you wish to kiss.");</p><p> return;</p><p> }</p><p></p><p> GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);</p><p> if (TargetClient == null)</p><p> {</p><p> Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online.");</p><p> return;</p><p> }</p><p></p><p> RoomUser TargetUser = Room.GetRoomUserManager().GetRoomUserByHabbo(TargetClient.GetHabbo().Id);</p><p> if (TargetUser == null)</p><p> {</p><p> Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online or in this room.");</p><p> return;</p><p> }</p><p></p><p> if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)</p><p> {</p><p> Session.SendWhisper("Come on, you can't kiss yourself!");</p><p> return;</p><p> }</p><p></p><p> RoomUser ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);</p><p> if (ThisUser == null)</p><p> return;</p><p></p><p> if (!((Math.Abs(TargetUser.X - ThisUser.X) >= 2) || (Math.Abs(TargetUser.Y - ThisUser.Y) >= 2)))</p><p> {</p><p> Room.SendMessage(new ChatComposer(ThisUser.VirtualId, "*Kisses " + Params[1] + "*", 0, ThisUser.LastBubble));</p><p> Session.GetHabbo().Effects().ApplyEffect(9);</p><p> TargetClient.GetHabbo().Effects().ApplyEffect(9);</p><p> }</p><p> else</p><p> {</p><p> Session.SendWhisper("Oops, " + Params[1] + " is not close enough!");</p><p> return;</p><p> }</p><p> }</p><p> }</p><p>}[/CODE]</p><p></p><p>I used that and named it KissCommand.cs</p><p></p><p>For the CommandManager I did this:</p><p>[CODE] this.Register("kiss", new KissCommand());[/CODE]</p></blockquote><p></p>
[QUOTE="Joshhh, post: 377346, member: 67621"] [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.Fun { class KissCommand : IChatCommand { public string PermissionRequired { get { return "command_kiss"; } } public string Parameters { get { return "%target%"; } } public string Description { get { return "Give another user a kiss."; } } public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { if (Params.Length == 1) { Session.SendWhisper("Please enter the username of the user you wish to kiss."); return; } GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]); if (TargetClient == null) { Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online."); 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("Come on, you can't kiss yourself!"); 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))) { Room.SendMessage(new ChatComposer(ThisUser.VirtualId, "*Kisses " + Params[1] + "*", 0, ThisUser.LastBubble)); Session.GetHabbo().Effects().ApplyEffect(9); TargetClient.GetHabbo().Effects().ApplyEffect(9); } else { Session.SendWhisper("Oops, " + Params[1] + " is not close enough!"); return; } } } }[/CODE] I used that and named it KissCommand.cs For the CommandManager I did this: [CODE] this.Register("kiss", new KissCommand());[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Boon Emulator Issues! + Custom Commands
Top