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
Suggestions
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="j0ker" data-source="post: 404325" data-attributes="member: 2010"><p>So I'm just dabbling into PlusEMU, im trying to make a simple mp5 command with a time delay between each room.sendmessage, any suggestions? heres the code im using:</p><p></p><p>[code]</p><p>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</p><p>{</p><p> class mp5Command : IChatCommand</p><p> {</p><p> public string PermissionRequired</p><p> {</p><p> get { return "command_mp5"; }</p><p> }</p><p></p><p> public string Parameters</p><p> {</p><p> get { return "%name%"; }</p><p> }</p><p></p><p> public string Description</p><p> {</p><p> get { return "Shoot a user"; }</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("Choose a user");</p><p> return;</p><p> }</p><p></p><p> if (!Room.PushEnabled && !Session.GetHabbo().GetPermissions().HasRight("room_override_custom_config"))</p><p> {</p><p> Session.SendWhisper("Room owner disabled shooting.");</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("User doesnt exist!");</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("You cant shoot yourself!");</p><p> return;</p><p> }</p><p></p><p> if (TargetUser.TeleportEnabled)</p><p> {</p><p> Session.SendWhisper("Oops, this person disabled violence!");</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></p><p> </p><p> ThisUser.ApplyEffect(499);</p><p></p><p> Room.SendMessage(new ChatComposer(ThisUser.VirtualId, "* Pulls out MP5 *", 1, ThisUser.LastBubble));</p><p> Room.SendMessage(new ChatComposer(ThisUser.VirtualId, "* takes aim at " + Params[1] + " *", 1, ThisUser.LastBubble));</p><p> TargetUser.ApplyEffect(93);</p><p> Room.SendMessage(new ChatComposer(TargetUser.VirtualId, "* has died from a fatal gunshot wound *", 1, ThisUser.LastBubble));</p><p> ThisUser.ApplyEffect(0);</p><p> TargetUser.ApplyEffect(0);</p><p> }</p><p></p><p> }</p><p> }</p><p>[/code]</p></blockquote><p></p>
[QUOTE="j0ker, post: 404325, member: 2010"] So I'm just dabbling into PlusEMU, im trying to make a simple mp5 command with a time delay between each room.sendmessage, any suggestions? heres the code im using: [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 mp5Command : IChatCommand { public string PermissionRequired { get { return "command_mp5"; } } public string Parameters { get { return "%name%"; } } public string Description { get { return "Shoot 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 shooting."); 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 shoot yourself!"); return; } if (TargetUser.TeleportEnabled) { Session.SendWhisper("Oops, this person disabled violence!"); return; } RoomUser ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (ThisUser == null) return; ThisUser.ApplyEffect(499); Room.SendMessage(new ChatComposer(ThisUser.VirtualId, "* Pulls out MP5 *", 1, ThisUser.LastBubble)); Room.SendMessage(new ChatComposer(ThisUser.VirtualId, "* takes aim at " + Params[1] + " *", 1, ThisUser.LastBubble)); TargetUser.ApplyEffect(93); Room.SendMessage(new ChatComposer(TargetUser.VirtualId, "* has died from a fatal gunshot wound *", 1, ThisUser.LastBubble)); ThisUser.ApplyEffect(0); TargetUser.ApplyEffect(0); } } } [/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Suggestions
Top