One Way Gates not working (RP)

uttmmmm5

Member
May 18, 2016
110
5
Hey there,
I have a problem with my one way gates.
I use them as job gates so only these people who work at this place should can go through the gates.
But it seems that isn't the problem.
The problem is I cant go through any one way gate.
Interaction_modes_count is set to 2 but it won't work.
You can doubleclick but nothing happens - have anybody an idea how i can fix these ?
(i use PlusEmulator)
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
In the database table check to make sure the following:
Width/Length are both equal to 1
Stack height is equal to .001
Walkable is equal to 0
Interaction_type is "onewaygate" , interaction_modes_count is equal to 2

Then in Furnidata ensure that:
<specialtype> = 1
<canstandon> = 0
<xdim> = 1
<ydim> = 1
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
Code:
 if (Item.BaseItem == 994)
                {
                    if (!User.GetClient().GetRolePlay().Working)
                    {
                        var This = User.GetClient().GetRolePlay();
                        if (This.Job == 0)
                        Session.SendWhisper("Du hast keinen Job!");
                        else if (This.Job > 0 && This.JobRoom == This.Room.Id)
                            Session.SendWhisper("Du musst die Arbeit beginnen um durch dieses Tor gehen zu können!");
                        else if (This.Job > 0 && This.JobRoom != This.Room.Id)
                            Session.SendWhisper("Du arbeitest hier nicht!");
                        return;
                    }
                }

If you are not "working" , but the rest of the conditions match, it just returns without telling the user to start working. That could be your issue. MAKE SURE YOU ARE WORKING :)

Replace This:
Code:
if (Item.InteractingUser == 0)
                {
                    User.InteractingGate = true;
                    User.GateId = Item.Id;
                    Item.InteractingUser = User.HabboId;
 
                    User.CanWalk = true;
 
                    if (User.IsWalking && (User.GoalX != Item.SquareInFront.X || User.GoalY != Item.SquareInFront.Y))
                    {
                        User.ClearMovement(true);
                    }
 
                    User.AllowOverride = true;
                    User.MoveTo(Item.Coordinate);
 
                    Item.RequestUpdate(4, true);
                }

With This:
Code:
if (Item.InteractingUser == 0)
                {
                    User.InteractingGate = true;
                    User.GateId = Item.Id;
                    Item.InteractingUser = User.HabboId;

                    User.CanWalk = false;

                    if (User.IsWalking && (User.GoalX != Item.SquareInFront.X || User.GoalY != Item.SquareInFront.Y))
                    {
                        User.ClearMovement(true);
                    }

                    User.AllowOverride = true;
                    User.MoveTo(Item.Coordinate);
                    Item.UpdateCounter = 2;
                    Item.ProcessUpdates();
                }
 

uttmmmm5

Member
May 18, 2016
110
5
Code:
 if (Item.BaseItem == 994)
                {
                    if (!User.GetClient().GetRolePlay().Working)
                    {
                        var This = User.GetClient().GetRolePlay();
                        if (This.Job == 0)
                        Session.SendWhisper("Du hast keinen Job!");
                        else if (This.Job > 0 && This.JobRoom == This.Room.Id)
                            Session.SendWhisper("Du musst die Arbeit beginnen um durch dieses Tor gehen zu können!");
                        else if (This.Job > 0 && This.JobRoom != This.Room.Id)
                            Session.SendWhisper("Du arbeitest hier nicht!");
                        return;
                    }
                }

If you are not "working" , but the rest of the conditions match, it just returns without telling the user to start working. That could be your issue. MAKE SURE YOU ARE WORKING :)

Replace This:
Code:
if (Item.InteractingUser == 0)
                {
                    User.InteractingGate = true;
                    User.GateId = Item.Id;
                    Item.InteractingUser = User.HabboId;
 
                    User.CanWalk = true;
 
                    if (User.IsWalking && (User.GoalX != Item.SquareInFront.X || User.GoalY != Item.SquareInFront.Y))
                    {
                        User.ClearMovement(true);
                    }
 
                    User.AllowOverride = true;
                    User.MoveTo(Item.Coordinate);
 
                    Item.RequestUpdate(4, true);
                }

With This:
Code:
if (Item.InteractingUser == 0)
                {
                    User.InteractingGate = true;
                    User.GateId = Item.Id;
                    Item.InteractingUser = User.HabboId;

                    User.CanWalk = false;

                    if (User.IsWalking && (User.GoalX != Item.SquareInFront.X || User.GoalY != Item.SquareInFront.Y))
                    {
                        User.ClearMovement(true);
                    }

                    User.AllowOverride = true;
                    User.MoveTo(Item.Coordinate);
                    Item.UpdateCounter = 2;
                    Item.ProcessUpdates();
                }

Thanks for your reply.
It is still not working...
After i double click the gate my habbo gets freezed (i cant walk/move anymore) but after that it happens nothing. I cant go through the gate - i'm just freezed, nothing else.

Is there everything correct? (item.cs)

Code:
#region One way gates
                        case InteractionType.ONE_WAY_GATE:

                            User = null;

                            if (InteractingUser > 0)
                            {
                                User = GetRoom().GetRoomUserManager().GetRoomUserByHabbo(InteractingUser);
                            }

                            if (User != null && User.X == GetX && User.Y == GetY)
                            {
                                ExtraData = "1";

                                User.MoveTo(SquareBehind);
                                User.InteractingGate = false;
                                User.GateId = 0;
                                RequestUpdate(1, false);
                                UpdateState(false, true);
                            }
                            else if (User != null && User.Coordinate == SquareBehind)
                            {
                                User.UnlockWalking();

                                ExtraData = "0";
                                InteractingUser = 0;
                                User.InteractingGate = false;
                                User.GateId = 0;
                                UpdateState(false, true);
                            }
                            else if (ExtraData == "1")
                            {
                                ExtraData = "0";
                                UpdateState(false, true);
                            }

                            if (User == null)
                            {
                                InteractingUser = 0;
                            }

                            break;
                        #endregion

The other file is looking now like this: (InteractorOneWayGate.cs)
Code:
using System;

using Plus.HabboHotel.GameClients;
using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.Users;
using Plus.HabboHotel.Groups;

namespace Plus.HabboHotel.Items.Interactor
{
    public class InteractorOneWayGate : IFurniInteractor
    {
        public void OnPlace(GameClient Session, Item Item)
        {
            Item.ExtraData = "0";

            if (Item.InteractingUser != 0)
            {
                RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser);

                if (User != null)
                {
                    User.ClearMovement(true);
                    User.UnlockWalking();
                }

                Item.InteractingUser = 0;
            }
        }

        public void OnRemove(GameClient Session, Item Item)
        {
            Item.ExtraData = "0";

            if (Item.InteractingUser != 0)
            {
                RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser);

                if (User != null)
                {
                    User.ClearMovement(true);
                    User.UnlockWalking();
                }

                Item.InteractingUser = 0;
            }
        }

        public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
        {
            if (Session == null)
                return;

            RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (Item.InteractingUser2 != User.UserId)
                Item.InteractingUser2 = User.UserId;

            if (User == null)
            {
                return;
            }
            if (Item.GetBaseItem().InteractionType == InteractionType.ONE_WAY_GATE)
            {
                if (Item.BaseItem == 994)
                {
                    if (!User.GetClient().GetRolePlay().Working)
                    {
                        var This = User.GetClient().GetRolePlay();
                        if (This.Job == 0)
                            Session.SendWhisper("Du hast keinen Job!");
                        else if (This.Job > 0 && This.JobRoom == This.Room.Id)
                            Session.SendWhisper("Du musst die Arbeit beginnen um durch dieses Tor gehen zu können!");
                        else if (This.Job > 0 && This.JobRoom != This.Room.Id)
                            Session.SendWhisper("Du arbeitest hier nicht!");
                        return;
                    }
                }
                if (User.Coordinate != Item.SquareInFront && User.CanWalk)
                {
                    User.MoveTo(Item.SquareInFront);
                    return;
                }
                if (!Item.GetRoom().GetGameMap().ValidTile(Item.SquareBehind.X, Item.SquareBehind.Y) ||
                    !Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, false)
                    || !Item.GetRoom().GetGameMap().SquareIsOpen(Item.SquareBehind.X, Item.SquareBehind.Y, false))
                {
                    return;
                }

                if ((User.LastInteraction - PlusEnvironment.GetUnixTimestamp() < 0) && User.InteractingGate &&
                    User.GateId == Item.Id)
                {
                    User.InteractingGate = false;
                    User.GateId = 0;
                }


                if (!Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, User.AllowOverride))
                {
                    return;
                }

                if (Item.InteractingUser == 0)
                {
                    User.InteractingGate = true;
                    User.GateId = Item.Id;
                    Item.InteractingUser = User.HabboId;

                    User.CanWalk = false;

                    if (User.IsWalking && (User.GoalX != Item.SquareInFront.X || User.GoalY != Item.SquareInFront.Y))
                    {
                        User.ClearMovement(true);
                    }

                    User.AllowOverride = true;
                    User.MoveTo(Item.Coordinate);
                    Item.UpdateCounter = 2;
                    Item.ProcessUpdates();
                }
            }
        }

        public void OnWiredTrigger(Item Item)
        {
        }
    }
}
 

uttmmmm5

Member
May 18, 2016
110
5
In the interaction class try
User.CanWalk = true;

Then my avatar doesn‘t freeze - i can still move but the gate isn‘t opening and i still can‘t go through.
 
Ok i tested a few things...
Its now the original code from the original plus emulator by @Sledmore inside. Should work!
I replaced the swf which i ripped off a habbo where i know it works 100%. Should work too!
so the only things where a mistake can be inside is furnidata.xml or in the database.

Database "Beige One Way Gate"
Code:
id: 994
item_name: one_way_door*4
public_name: Beige One Way Gate
type: s
width: 1
lenght: 1
stack_height: 0.001
can_stack: 1
can_sit: 0
is_walkable: 0
sprite_id: 2600
allow_recycle: 1
allow_trade: 1
allow_marketplace_sell: 1
allow_gift: 1
allow_inventory_stack: 1
interaction_type: onewaygate
interaction_modes_count: 2
vending_ids: 0
height_adjustable: 0
effect_id: 0
wired_id: 0
clothing_id: 0
extra_rot: 0

furnidata.xml
Code:
<furnitype id="2600" classname="one_way_door*4">
<revision>45508</revision>
<defaultdir>0</defaultdir>
<xdim>1</xdim>
<ydim>1</ydim>
<partcolors>
<color>#F7EBBC</color>
<color>#FFFFFF</color>
<color>#F7EBBC</color>
<color>#FFFFFF</color>
<color>#FFFFFF</color>
</partcolors>
<name>Beige One Way Gate</name>
<description>Get in line.</description>
<adurl></adurl>
<offerid>-1</offerid>
<buyout>0</buyout>
<rentofferid>-1</rentofferid>
<rentbuyout>0</rentbuyout>
<bc>0</bc>
<excludeddynamic>0</excludeddynamic>
<customparams></customparams>
<specialtype>1</specialtype>
<canstandon>0</canstandon>
<cansiton>0</cansiton>
<canlayon>0</canlayon>
</furnitype>
 

Users who are viewing this thread

Top