Open Alert after doubleclick furni (need help)

uttmmmm5

Member
May 18, 2016
110
5
Hey DevBest,
I try to do the following thing:
When i double click this item:
it should open an alert like this:
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)
        {
        }
    }
}

InteractionType.cs (added the following)
Code:
case "rp":
return InteractionType.RP;

Item.cs (added the following)
Code:
case InteractionType.RP:
return new InteractorRP();

In the database i change the interaction_type to "rp" and set interaction_modes_count to "2" --->

So idk now what i did wrong and how i can fix this, but maybe someone here can help me :)

Best Regards
 

Users who are viewing this thread

Top