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
Open Alert after doubleclick furni (need help)
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="uttmmmm5" data-source="post: 426608" data-attributes="member: 68424"><p>Hey DevBest,</p><p>I try to do the following thing:</p><p>When i double click this item: <a href="https://prnt.sc/i1jwk7" target="_blank">https://prnt.sc/i1jwk7</a></p><p>it should open an alert like this: <a href="https://prnt.sc/i1jwza" target="_blank">https://prnt.sc/i1jwza</a></p><p>Where it should show any informations from this room.</p><p>But it isn't working yet. When i double click the item, nothing happens.</p><p></p><p>Now here is what i did:</p><p>InteractorRP.cs</p><p>[CODE]using Plus.HabboHotel.GameClients;</p><p>using Plus.Database.Interfaces;</p><p>using Plus.HabboHotel.Rooms;</p><p>using System;</p><p>using System.Data;</p><p>using Plus.Communication.Packets.Outgoing.Notifications;</p><p>using Plus.HabboHotel.Quests;</p><p></p><p>namespace Plus.HabboHotel.Items.Interactor</p><p>{</p><p> public class InteractorRP : IFurniInteractor</p><p> {</p><p></p><p> public void OnPlace(GameClient Session, Item Item)</p><p> {</p><p> </p><p> }</p><p></p><p> public void OnRemove(GameClient Session, Item Item)</p><p> {</p><p> </p><p> }</p><p></p><p> public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)</p><p> {</p><p> </p><p> if (Item.BaseItem == 5315) // Informations-Konsole BaseID</p><p> {</p><p> string help = "================== Raumhilfe & Befehle ===================\n\n";</p><p> using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> {</p><p> dbClient.SetQuery("SELECT * FROM `roomhelp` WHERE `roomid` = '" + Session.GetHabbo().CurrentRoomId + "'");</p><p> DataTable Table = dbClient.getTable();</p><p> foreach (DataRow Row in Table.Rows)</p><p> {</p><p> int HelpType = Convert.ToInt32(Row["type"]);</p><p> if (HelpType == 1)</p><p> {</p><p> help += "" + Row["details"] + "\n";</p><p> }</p><p> else</p><p> {</p><p> help += "" + Row["details"] + "\n\n";</p><p> }</p><p> }</p><p> }</p><p> Session.SendMessage(new MOTDNotificationComposer("Informationen:\n\n" + help.ToString()));</p><p> }</p><p></p><p> if (Session == null)</p><p> return;</p><p></p><p> RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);</p><p> if (User == null)</p><p> return;</p><p></p><p> if (Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y))</p><p> {</p><p> int Modes = Item.GetBaseItem().Modes - 1;</p><p></p><p> if (Modes <= 0)</p><p> return;</p><p></p><p> PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.FURNI_SWITCH);</p><p></p><p> int CurrentMode = 0;</p><p> int NewMode = 0;</p><p></p><p> if (!int.TryParse(Item.ExtraData, out CurrentMode))</p><p> {</p><p> }</p><p></p><p> if (CurrentMode <= 0)</p><p> NewMode = 1;</p><p> else if (CurrentMode >= Modes)</p><p> NewMode = 0;</p><p> else</p><p> NewMode = CurrentMode + 1;</p><p></p><p> Item.ExtraData = NewMode.ToString();</p><p> Item.UpdateState();</p><p> }</p><p> else</p><p> User.MoveTo(Item.SquareInFront);</p><p> }</p><p></p><p> public void OnWiredTrigger(Item Item)</p><p> {</p><p> }</p><p> }</p><p>}[/CODE]</p><p></p><p>InteractionType.cs (added the following)</p><p>[CODE]case "rp":</p><p>return InteractionType.RP;[/CODE]</p><p></p><p>Item.cs (added the following)</p><p>[CODE]case InteractionType.RP:</p><p>return new InteractorRP();[/CODE]</p><p></p><p>In the database i change the interaction_type to "rp" and set interaction_modes_count to "2" ---> <a href="https://prnt.sc/i1jzcz" target="_blank">https://prnt.sc/i1jzcz</a></p><p></p><p>So idk now what i did wrong and how i can fix this, but maybe someone here can help me <img src="/styles/default/xenforo/smilies/emojione/smile.png" class="smilie" loading="lazy" alt=":)" title="Smile :)" data-shortname=":)" /></p><p></p><p>Best Regards</p></blockquote><p></p>
[QUOTE="uttmmmm5, post: 426608, member: 68424"] Hey DevBest, I try to do the following thing: When i double click this item: [URL]https://prnt.sc/i1jwk7[/URL] it should open an alert like this: [URL]https://prnt.sc/i1jwza[/URL] Where it should show any informations from this room. But it isn't working yet. When i double click the item, nothing happens. Now here is what i did: InteractorRP.cs [CODE]using Plus.HabboHotel.GameClients; using Plus.Database.Interfaces; using Plus.HabboHotel.Rooms; using System; using System.Data; using Plus.Communication.Packets.Outgoing.Notifications; using Plus.HabboHotel.Quests; namespace Plus.HabboHotel.Items.Interactor { public class InteractorRP : IFurniInteractor { public void OnPlace(GameClient Session, Item Item) { } public void OnRemove(GameClient Session, Item Item) { } public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights) { if (Item.BaseItem == 5315) // Informations-Konsole BaseID { string help = "================== Raumhilfe & Befehle ===================\n\n"; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT * FROM `roomhelp` WHERE `roomid` = '" + Session.GetHabbo().CurrentRoomId + "'"); DataTable Table = dbClient.getTable(); foreach (DataRow Row in Table.Rows) { int HelpType = Convert.ToInt32(Row["type"]); if (HelpType == 1) { help += "" + Row["details"] + "\n"; } else { help += "" + Row["details"] + "\n\n"; } } } Session.SendMessage(new MOTDNotificationComposer("Informationen:\n\n" + help.ToString())); } if (Session == null) return; RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (User == null) return; if (Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y)) { int Modes = Item.GetBaseItem().Modes - 1; if (Modes <= 0) return; PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.FURNI_SWITCH); int CurrentMode = 0; int NewMode = 0; if (!int.TryParse(Item.ExtraData, out CurrentMode)) { } if (CurrentMode <= 0) NewMode = 1; else if (CurrentMode >= Modes) NewMode = 0; else NewMode = CurrentMode + 1; Item.ExtraData = NewMode.ToString(); Item.UpdateState(); } else User.MoveTo(Item.SquareInFront); } public void OnWiredTrigger(Item Item) { } } }[/CODE] InteractionType.cs (added the following) [CODE]case "rp": return InteractionType.RP;[/CODE] Item.cs (added the following) [CODE]case InteractionType.RP: return new InteractorRP();[/CODE] In the database i change the interaction_type to "rp" and set interaction_modes_count to "2" ---> [URL]https://prnt.sc/i1jzcz[/URL] So idk now what i did wrong and how i can fix this, but maybe someone here can help me :) Best Regards [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Open Alert after doubleclick furni (need help)
Top