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
One Way Gates not working (RP)
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: 426439" data-attributes="member: 68424"><p>Thanks for your reply.</p><p>It is still not working...</p><p>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.</p><p></p><p>Is there everything correct? (item.cs)</p><p></p><p>[CODE]#region One way gates</p><p> case InteractionType.ONE_WAY_GATE:</p><p></p><p> User = null;</p><p></p><p> if (InteractingUser > 0)</p><p> {</p><p> User = GetRoom().GetRoomUserManager().GetRoomUserByHabbo(InteractingUser);</p><p> }</p><p></p><p> if (User != null && User.X == GetX && User.Y == GetY)</p><p> {</p><p> ExtraData = "1";</p><p></p><p> User.MoveTo(SquareBehind);</p><p> User.InteractingGate = false;</p><p> User.GateId = 0;</p><p> RequestUpdate(1, false);</p><p> UpdateState(false, true);</p><p> }</p><p> else if (User != null && User.Coordinate == SquareBehind)</p><p> {</p><p> User.UnlockWalking();</p><p></p><p> ExtraData = "0";</p><p> InteractingUser = 0;</p><p> User.InteractingGate = false;</p><p> User.GateId = 0;</p><p> UpdateState(false, true);</p><p> }</p><p> else if (ExtraData == "1")</p><p> {</p><p> ExtraData = "0";</p><p> UpdateState(false, true);</p><p> }</p><p></p><p> if (User == null)</p><p> {</p><p> InteractingUser = 0;</p><p> }</p><p></p><p> break;</p><p> #endregion[/CODE]</p><p></p><p>The other file is looking now like this: (InteractorOneWayGate.cs)</p><p>[CODE]using System;</p><p></p><p>using Plus.HabboHotel.GameClients;</p><p>using Plus.HabboHotel.Rooms;</p><p>using Plus.HabboHotel.Users;</p><p>using Plus.HabboHotel.Groups;</p><p></p><p>namespace Plus.HabboHotel.Items.Interactor</p><p>{</p><p> public class InteractorOneWayGate : IFurniInteractor</p><p> {</p><p> public void OnPlace(GameClient Session, Item Item)</p><p> {</p><p> Item.ExtraData = "0";</p><p></p><p> if (Item.InteractingUser != 0)</p><p> {</p><p> RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser);</p><p></p><p> if (User != null)</p><p> {</p><p> User.ClearMovement(true);</p><p> User.UnlockWalking();</p><p> }</p><p></p><p> Item.InteractingUser = 0;</p><p> }</p><p> }</p><p></p><p> public void OnRemove(GameClient Session, Item Item)</p><p> {</p><p> Item.ExtraData = "0";</p><p></p><p> if (Item.InteractingUser != 0)</p><p> {</p><p> RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser);</p><p></p><p> if (User != null)</p><p> {</p><p> User.ClearMovement(true);</p><p> User.UnlockWalking();</p><p> }</p><p></p><p> Item.InteractingUser = 0;</p><p> }</p><p> }</p><p></p><p> public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)</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></p><p> if (Item.InteractingUser2 != User.UserId)</p><p> Item.InteractingUser2 = User.UserId;</p><p></p><p> if (User == null)</p><p> {</p><p> return;</p><p> }</p><p> if (Item.GetBaseItem().InteractionType == InteractionType.ONE_WAY_GATE)</p><p> {</p><p> if (Item.BaseItem == 994)</p><p> {</p><p> if (!User.GetClient().GetRolePlay().Working)</p><p> {</p><p> var This = User.GetClient().GetRolePlay();</p><p> if (This.Job == 0)</p><p> Session.SendWhisper("Du hast keinen Job!");</p><p> else if (This.Job > 0 && This.JobRoom == This.Room.Id)</p><p> Session.SendWhisper("Du musst die Arbeit beginnen um durch dieses Tor gehen zu können!");</p><p> else if (This.Job > 0 && This.JobRoom != This.Room.Id)</p><p> Session.SendWhisper("Du arbeitest hier nicht!");</p><p> return;</p><p> }</p><p> }</p><p> if (User.Coordinate != Item.SquareInFront && User.CanWalk)</p><p> {</p><p> User.MoveTo(Item.SquareInFront);</p><p> return;</p><p> }</p><p> if (!Item.GetRoom().GetGameMap().ValidTile(Item.SquareBehind.X, Item.SquareBehind.Y) ||</p><p> !Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, false)</p><p> || !Item.GetRoom().GetGameMap().SquareIsOpen(Item.SquareBehind.X, Item.SquareBehind.Y, false))</p><p> {</p><p> return;</p><p> }</p><p></p><p> if ((User.LastInteraction - PlusEnvironment.GetUnixTimestamp() < 0) && User.InteractingGate &&</p><p> User.GateId == Item.Id)</p><p> {</p><p> User.InteractingGate = false;</p><p> User.GateId = 0;</p><p> }</p><p></p><p></p><p> if (!Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, User.AllowOverride))</p><p> {</p><p> return;</p><p> }</p><p></p><p> if (Item.InteractingUser == 0)</p><p> {</p><p> User.InteractingGate = true;</p><p> User.GateId = Item.Id;</p><p> Item.InteractingUser = User.HabboId;</p><p></p><p> User.CanWalk = false;</p><p></p><p> if (User.IsWalking && (User.GoalX != Item.SquareInFront.X || User.GoalY != Item.SquareInFront.Y))</p><p> {</p><p> User.ClearMovement(true);</p><p> }</p><p></p><p> User.AllowOverride = true;</p><p> User.MoveTo(Item.Coordinate);</p><p> Item.UpdateCounter = 2;</p><p> Item.ProcessUpdates();</p><p> }</p><p> }</p><p> }</p><p></p><p> public void OnWiredTrigger(Item Item)</p><p> {</p><p> }</p><p> }</p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="uttmmmm5, post: 426439, member: 68424"] 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[/CODE] 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) { } } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
One Way Gates not working (RP)
Top