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 Releases
Server Releases
PlusEMU Faceless Command
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="Wouto" data-source="post: 264313" data-attributes="member: 3046"><p>This isn't anything special but I was questioned alot on my hotel about how a user could become Faceless so I coded a command to make them faceless and I thought I would share it with the community, this probably isn't the best way of doing it but it does the job I guess?</p><p></p><p>Place the code below into ChatCommandHandler.cs (I think thats the file name not 100% sure).</p><p>[CODE] #region Faceless</p><p> case "faceless":</p><p> {</p><p> string[] figureParts;</p><p> string[] headParts;</p><p></p><p> figureParts = Session.GetHabbo().Look.Split('.');</p><p> foreach (string Part in figureParts)</p><p> {</p><p> if (Part.StartsWith("hd"))</p><p> {</p><p> headParts = Part.Split('-');</p><p></p><p> if (!headParts[1].Equals("99999"))</p><p> headParts[1] = "99999";</p><p> else</p><p> break;</p><p></p><p> string NewHead = "hd-" + headParts[1] + "-" + headParts[2];</p><p></p><p> Session.GetHabbo().Look = Session.GetHabbo().Look.Replace(Part, NewHead);</p><p> break;</p><p> }</p><p> }</p><p></p><p> using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().getQueryreactor())</p><p> {</p><p> dbClient.setQuery("UPDATE users SET look = @Look WHERE username = @username");</p><p> dbClient.addParameter("look", Session.GetHabbo().Look);</p><p> dbClient.addParameter("username", Session.GetHabbo().Username);</p><p> dbClient.runQuery();</p><p> }</p><p></p><p> Room Room = Session.GetHabbo().CurrentRoom;</p><p></p><p> if (Room == null)</p><p> break;</p><p></p><p> RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);</p><p></p><p> if (User == null)</p><p> break;</p><p> </p><p> #region Messages</p><p> Session.GetMessageHandler().GetResponse().Init(Outgoing.UpdateUserInformation);</p><p> Session.GetMessageHandler().GetResponse().AppendInt32(-1);</p><p> Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Look);</p><p> Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Gender.ToLower());</p><p> Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Motto);</p><p> Session.GetMessageHandler().GetResponse().AppendInt32(Session.GetHabbo().AchievementPoints);</p><p> Session.GetMessageHandler().SendResponse();</p><p></p><p> ServerMessage RoomUpdate = new ServerMessage(Outgoing.UpdateUserInformation);</p><p> RoomUpdate.AppendInt32(User.VirtualId);</p><p> RoomUpdate.AppendString(Session.GetHabbo().Look);</p><p> RoomUpdate.AppendString(Session.GetHabbo().Gender.ToLower());</p><p> RoomUpdate.AppendString(Session.GetHabbo().Motto);</p><p> RoomUpdate.AppendInt32(Session.GetHabbo().AchievementPoints);</p><p> Room.SendMessage(RoomUpdate);</p><p> #endregion</p><p> break;</p><p> }</p><p>#endregion[/CODE]</p></blockquote><p></p>
[QUOTE="Wouto, post: 264313, member: 3046"] This isn't anything special but I was questioned alot on my hotel about how a user could become Faceless so I coded a command to make them faceless and I thought I would share it with the community, this probably isn't the best way of doing it but it does the job I guess? Place the code below into ChatCommandHandler.cs (I think thats the file name not 100% sure). [CODE] #region Faceless case "faceless": { string[] figureParts; string[] headParts; figureParts = Session.GetHabbo().Look.Split('.'); foreach (string Part in figureParts) { if (Part.StartsWith("hd")) { headParts = Part.Split('-'); if (!headParts[1].Equals("99999")) headParts[1] = "99999"; else break; string NewHead = "hd-" + headParts[1] + "-" + headParts[2]; Session.GetHabbo().Look = Session.GetHabbo().Look.Replace(Part, NewHead); break; } } using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().getQueryreactor()) { dbClient.setQuery("UPDATE users SET look = @Look WHERE username = @username"); dbClient.addParameter("look", Session.GetHabbo().Look); dbClient.addParameter("username", Session.GetHabbo().Username); dbClient.runQuery(); } Room Room = Session.GetHabbo().CurrentRoom; if (Room == null) break; RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (User == null) break; #region Messages Session.GetMessageHandler().GetResponse().Init(Outgoing.UpdateUserInformation); Session.GetMessageHandler().GetResponse().AppendInt32(-1); Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Look); Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Gender.ToLower()); Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Motto); Session.GetMessageHandler().GetResponse().AppendInt32(Session.GetHabbo().AchievementPoints); Session.GetMessageHandler().SendResponse(); ServerMessage RoomUpdate = new ServerMessage(Outgoing.UpdateUserInformation); RoomUpdate.AppendInt32(User.VirtualId); RoomUpdate.AppendString(Session.GetHabbo().Look); RoomUpdate.AppendString(Session.GetHabbo().Gender.ToLower()); RoomUpdate.AppendString(Session.GetHabbo().Motto); RoomUpdate.AppendInt32(Session.GetHabbo().AchievementPoints); Room.SendMessage(RoomUpdate); #endregion break; } #endregion[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
PlusEMU Faceless Command
Top