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
PlusEMU New Added Colours Don't Stick?
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="Hypothesis" data-source="post: 455964" data-attributes="member: 83881"><p>I thought name colors were just a session thing, I thought they reset when you go offline. What you can probably do is have it set the name color on disconnect.</p><p>Go into your Habbo.cs, search for OnDisconnect(), then replace the entire method with this.</p><p>[CODE]public void OnDisconnect()</p><p> {</p><p> if (this._disconnected)</p><p> return;</p><p></p><p> try</p><p> {</p><p> if (this._process != null)</p><p> this._process.Dispose();</p><p> }</p><p> catch { }</p><p></p><p> this._disconnected = true;</p><p></p><p> PlusEnvironment.GetGame().GetClientManager().UnregisterClient(Id, Username);</p><p></p><p> if (!this._habboSaved)</p><p> {</p><p> this._habboSaved = true;</p><p> using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> {</p><p> dbClient.RunQuery("UPDATE `users` SET `online` = '0', `namecolor` = '" + this.ChatColor + "'," + " `last_online` = '" + PlusEnvironment.GetUnixTimestamp() + "', `activity_points` = '" + this.Duckets + "', `credits` = '" + this.Credits + "', `vip_points` = '" + this.Diamonds + "', `home_room` = '" + this.HomeRoom + "', `gotw_points` = '" + this.GOTWPoints + "', `time_muted` = '" + this.TimeMuted + "',`friend_bar_state` = '" + FriendBarStateUtility.GetInt(this._friendbarState) + "' WHERE id = '" + Id + "' LIMIT 1;UPDATE `user_stats` SET `roomvisits` = '" + this._habboStats.RoomVisits + "', `onlineTime` = '" + (PlusEnvironment.GetUnixTimestamp() - this.SessionStart + this._habboStats.OnlineTime) + "', `respect` = '" + this._habboStats.Respect + "', `respectGiven` = '" + this._habboStats.RespectGiven + "', `giftsGiven` = '" + this._habboStats.GiftsGiven + "', `giftsReceived` = '" + this._habboStats.GiftsReceived + "', `dailyRespectPoints` = '" + this._habboStats.DailyRespectPoints + "', `dailyPetRespectPoints` = '" + this._habboStats.DailyPetRespectPoints + "', `AchievementScore` = '" + this._habboStats.AchievementPoints + "', `quest_id` = '" + this._habboStats.QuestID + "', `quest_progress` = '" + this._habboStats.QuestProgress + "', `groupid` = '" + this._habboStats.FavouriteGroupId + "',`forum_posts` = '" + this._habboStats.ForumPosts +"' WHERE `id` = '" + this.Id + "' LIMIT 1;");</p><p></p><p> if (GetPermissions().HasRight("mod_tickets"))</p><p> dbClient.RunQuery("UPDATE `moderation_tickets` SET `status` = 'open', `moderator_id` = '0' WHERE `status` ='picked' AND `moderator_id` = '" + Id + "'");</p><p> }</p><p> }</p><p></p><p> this.Dispose();</p><p></p><p> this._client = null;</p><p></p><p> }[/CODE]</p><p></p><p>If you have issues with the code, let me know, or DM me on Discord.</p></blockquote><p></p>
[QUOTE="Hypothesis, post: 455964, member: 83881"] I thought name colors were just a session thing, I thought they reset when you go offline. What you can probably do is have it set the name color on disconnect. Go into your Habbo.cs, search for OnDisconnect(), then replace the entire method with this. [CODE]public void OnDisconnect() { if (this._disconnected) return; try { if (this._process != null) this._process.Dispose(); } catch { } this._disconnected = true; PlusEnvironment.GetGame().GetClientManager().UnregisterClient(Id, Username); if (!this._habboSaved) { this._habboSaved = true; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.RunQuery("UPDATE `users` SET `online` = '0', `namecolor` = '" + this.ChatColor + "'," + " `last_online` = '" + PlusEnvironment.GetUnixTimestamp() + "', `activity_points` = '" + this.Duckets + "', `credits` = '" + this.Credits + "', `vip_points` = '" + this.Diamonds + "', `home_room` = '" + this.HomeRoom + "', `gotw_points` = '" + this.GOTWPoints + "', `time_muted` = '" + this.TimeMuted + "',`friend_bar_state` = '" + FriendBarStateUtility.GetInt(this._friendbarState) + "' WHERE id = '" + Id + "' LIMIT 1;UPDATE `user_stats` SET `roomvisits` = '" + this._habboStats.RoomVisits + "', `onlineTime` = '" + (PlusEnvironment.GetUnixTimestamp() - this.SessionStart + this._habboStats.OnlineTime) + "', `respect` = '" + this._habboStats.Respect + "', `respectGiven` = '" + this._habboStats.RespectGiven + "', `giftsGiven` = '" + this._habboStats.GiftsGiven + "', `giftsReceived` = '" + this._habboStats.GiftsReceived + "', `dailyRespectPoints` = '" + this._habboStats.DailyRespectPoints + "', `dailyPetRespectPoints` = '" + this._habboStats.DailyPetRespectPoints + "', `AchievementScore` = '" + this._habboStats.AchievementPoints + "', `quest_id` = '" + this._habboStats.QuestID + "', `quest_progress` = '" + this._habboStats.QuestProgress + "', `groupid` = '" + this._habboStats.FavouriteGroupId + "',`forum_posts` = '" + this._habboStats.ForumPosts +"' WHERE `id` = '" + this.Id + "' LIMIT 1;"); if (GetPermissions().HasRight("mod_tickets")) dbClient.RunQuery("UPDATE `moderation_tickets` SET `status` = 'open', `moderator_id` = '0' WHERE `status` ='picked' AND `moderator_id` = '" + Id + "'"); } } this.Dispose(); this._client = null; }[/CODE] If you have issues with the code, let me know, or DM me on Discord. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
PlusEMU New Added Colours Don't Stick?
Top