[FIX] Group Gate #UPDATE / VERSION 2

Results 1 to 15 of 15
  1. #1
    Member Silas R is offline
    MemberRank
    May 2012 Join Date
    51Posts

    [FIX] Group Gate #UPDATE / VERSION 2

    Here a fix for the group gates. After this fix only group members can pass through the gate.

    First do this: http://forum.ragezone.com/f353/fix-one-way-gate-906384/
    And than find the group gate in your items_base (id 4532) and change the interaction type to gld_gate.

    In HabboHotel/Items/InteractionType.cs find
    Code:
    onewaygate,
    After that put
    Code:
    gld_gate,
    In HabboHotel/Items/InterractionTypes.cs find
    Code:
                    case "onewaygate":
                        return InteractionType.onewaygate;
    After that put
    Code:
                    case "gld_gate":
                        return InteractionType.gld_gate;
    Further down on that same page( HabboHotel/Items/InterractionTypes.cs) find another instance of
    Code:
                        case InteractionType.onewaygate: 
                        return "onewaygate";
    After that put
    Code:
                        case InteractionType.gld_gate: 
                        return "gld_gate";
    In RoomItems.cs find
    Code:
                        case InteractionType.onewaygate: 
                            return new InteractorOneWayGate();
    After that put
    Code:
                        case InteractionType.gld_gate: 
                            return new InteractorOneWayGate();
    In RoomItems.cs find
    Code:
                        case InteractionType.onewaygate: 
                            roomUserByHabbo = null;
    Change that to
    Code:
                        case InteractionType.onewaygate: 
                        case InteractionType.gld_gate: 
                            roomUserByHabbo = null;
    In InteractorOneWayGate.cs find
    Code:
    internal override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
    Replace that entire method with this one
    Old Version:
    Spoiler:

    Code:
            internal override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
            {
                if (Session != null)
                {
                    if (Item.GetBaseItem().InteractionType == InteractionType.onewaygate)
                    {
                        RoomUser roomUserByHabbo = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
                        if (roomUserByHabbo != null)
                        {
                            if ((roomUserByHabbo.Coordinate != Item.SquareInFront) && roomUserByHabbo.CanWalk)
                            {
                                roomUserByHabbo.MoveTo(Item.SquareInFront);
                            }
                            else if (Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, roomUserByHabbo.AllowOverride) && (Item.InteractingUser == 0))
                            {
                                Item.InteractingUser = roomUserByHabbo.HabboId;
                                roomUserByHabbo.CanWalk = false;
                                if (roomUserByHabbo.IsWalking && ((roomUserByHabbo.GoalX != Item.SquareInFront.X) || (roomUserByHabbo.GoalY != Item.SquareInFront.Y)))
                                {
                                    roomUserByHabbo.ClearMovement(true);
                                }
                                roomUserByHabbo.AllowOverride = true;
                                roomUserByHabbo.MoveTo(Item.Coordinate);
                                Item.ReqUpdate(4, true);
    
                            }
                        }
                    }
    
                    if (Item.GetBaseItem().InteractionType == InteractionType.gld_gate)
                    {
                        if (Session.GetHabbo().ImGuilds.Contains(Convert.ToInt32(Item.Guilds_Data[0])))
                        {
                            RoomUser roomUserByHabbo = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
                            if (roomUserByHabbo != null)
                            {
                                if ((roomUserByHabbo.Coordinate != Item.SquareInFront) && roomUserByHabbo.CanWalk)
                                {
                                    roomUserByHabbo.MoveTo(Item.SquareInFront);
    
                                }
                                else if (Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, roomUserByHabbo.AllowOverride) && (Item.InteractingUser == 0))
                                {
                                    Item.ExtraData = "1";
                                    Item.UpdateState(false, true);
                                    System.Threading.Thread.Sleep(1000);
                                    Item.InteractingUser = roomUserByHabbo.HabboId;
                                    roomUserByHabbo.CanWalk = false;
                                    if (roomUserByHabbo.IsWalking && ((roomUserByHabbo.GoalX != Item.SquareInFront.X) || (roomUserByHabbo.GoalY != Item.SquareInFront.Y)))
                                    {
                                        roomUserByHabbo.ClearMovement(true);
                                    }
                                    roomUserByHabbo.AllowOverride = true;
                                    roomUserByHabbo.MoveTo(Item.Coordinate);
                                    Item.ReqUpdate(4, true);
                                    roomUserByHabbo.MoveTo(Item.SquareBehind);
                                }
                            }
                        }
                        else
                        {
                            Session.SendNotif("Only group members can open this gate.");
                        }
                    }
    
                }
            }

    New Version:
    Spoiler:

    internal override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
    {
    if (Session != null)
    {
    if (Item.GetBaseItem().InteractionType == InteractionType.onewaygate)
    {
    RoomUser roomUserByHabbo = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
    if (roomUserByHabbo != null)
    {
    if ((roomUserByHabbo.Coordinate != Item.SquareInFront) && roomUserByHabbo.CanWalk)
    {
    roomUserByHabbo.MoveTo(Item.SquareInFront);
    }
    else if (Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, roomUserByHabbo.AllowOverride) && (Item.InteractingUser == 0))
    {
    Item.InteractingUser = roomUserByHabbo.HabboId;
    roomUserByHabbo.CanWalk = false;
    if (roomUserByHabbo.IsWalking && ((roomUserByHabbo.GoalX != Item.SquareInFront.X) || (roomUserByHabbo.GoalY != Item.SquareInFront.Y)))
    {
    roomUserByHabbo.ClearMovement(true);
    }
    roomUserByHabbo.AllowOverride = true;
    roomUserByHabbo.MoveTo(Item.Coordinate);
    Item.ReqUpdate(4, true);

    }
    }
    }

    if (Item.GetBaseItem().InteractionType == InteractionType.gld_gate)
    {
    if (Session.GetHabbo().ImGuilds.Contains(Convert.ToInt32(Item.Guilds_Data[0])))
    {
    RoomUser roomUserByHabbo = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
    if (roomUserByHabbo != null)
    {
    if (Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, roomUserByHabbo.AllowOverride) && roomUserByHabbo.Coordinate == Item.SquareInFront && (Item.InteractingUser == 0))
    {
    Item.ExtraData = "1";
    Item.UpdateState(false, true);
    System.Threading.Thread.Sleep(1000);
    Item.InteractingUser = roomUserByHabbo.HabboId;
    roomUserByHabbo.CanWalk = false;
    roomUserByHabbo.AllowOverride = true;
    roomUserByHabbo.MoveTo(Item.Coordinate);
    Item.ExtraData = "0";
    Item.UpdateState(false, true);
    roomUserByHabbo.MoveTo(Item.SquareBehind);
    roomUserByHabbo.CanWalk = true;
    System.Threading.Thread.Sleep(1000);
    roomUserByHabbo.AllowOverride = false;
    Item.InteractingUser = 0;
    }
    else if (Item.GetRoom().GetGameMap().CanWalk(Item.SquareInFront.X, Item.SquareInFront.Y, roomUserByHabbo.AllowOverride) && roomUserByHabbo.Coordinate == Item.SquareBehind && (Item.InteractingUser == 0))
    {
    Item.ExtraData = "1";
    Item.UpdateState(false, true);
    System.Threading.Thread.Sleep(1000);
    Item.InteractingUser = roomUserByHabbo.HabboId;
    roomUserByHabbo.CanWalk = false;
    roomUserByHabbo.AllowOverride = true;
    roomUserByHabbo.MoveTo(Item.Coordinate);
    Item.ExtraData = "0";
    Item.UpdateState(false, true);
    roomUserByHabbo.MoveTo(Item.SquareInFront);
    roomUserByHabbo.CanWalk = true;
    System.Threading.Thread.Sleep(1000);
    roomUserByHabbo.AllowOverride = false;
    Item.InteractingUser = 0;
    }
    }
    }
    else
    {
    Session.SendNotif("Nur Gruppen Mitglieder können dieses Tor benutzen.");
    }
    }

    }
    }


    Changelog:
    - Version 2:
    - Now you can enter by 2 sides


    That should do it.

    Thanks leenster for doing the basis.
    Thanks to me for fixing the fix and for improving.

    Video: BcStrom Group Gates Fix - YouTube
    Last edited by Silas R; 25-01-13 at 12:49 PM.


  2. #2
    I (L) Willem Spot Ify is offline
    MemberRank
    Jun 2012 Join Date
    The NetherlandsLocation
    294Posts

    Re: [FIX] Group Gate

    Nice fix
    We are going to a good emulator :) With all this fixes

  3. #3
    Member Silas R is offline
    MemberRank
    May 2012 Join Date
    51Posts

    Re: [FIX] Group Gate

    The fix from leenster don't work for me, and you walk in the gate.
    in my version opens the gate first, and then you go through it.

  4. #4
    Member Qbus is offline
    MemberRank
    Mar 2012 Join Date
    In your mind.Location
    60Posts

    Re: [FIX] Group Gate

    Not working by me

  5. #5
    Banned rafa95123 is offline
    BannedRank
    May 2009 Join Date
    /home/RaphaLocation
    564Posts

    Re: [FIX] Group Gate

    For me works fine. Thanks bro ;)

  6. #6
    Banned Habp is offline
    BannedRank
    Mar 2012 Join Date
    TCPOELocation
    208Posts

    Re: [FIX] Group Gate

    Mine still won't work, why don't you just upload the files for "noobs"? :p

  7. #7
    Not My Daddy Joorren XD is offline
    Old SchoolRank
    Feb 2010 Join Date
    1,558Posts

    Re: [FIX] Group Gate

    If I get it, you can ony enter the gate by 1 side?
    + on habbo you can walk on the gate and you can stay on it.
    When you click on it now, you just walk trought.

    But step by step, this is a helpfull fix ;)

  8. #8
    Banned Habp is offline
    BannedRank
    Mar 2012 Join Date
    TCPOELocation
    208Posts

    Re: [FIX] Group Gate

    Quote Originally Posted by Joorren View Post
    If I get it, you can ony enter the gate by 1 side?
    + on habbo you can walk on the gate and you can stay on it.
    When you click on it now, you just walk trought.

    But step by step, this is a helpfull fix ;)
    Can you send me your files? i can't walk on it and i cant even open it with a other member then the admin.

  9. #9
    Owner of Habbo.ac iRaged is offline
    MemberRank
    Nov 2011 Join Date
    229Posts

    Re: [FIX] Group Gate

    Quote Originally Posted by HabflareH View Post
    nice rip? this is already released.
    He fixed leensters fix. Now the user shouldn't walk onto the door before it opens I assume.

  10. #10
    [̲̅$̲̅(̲̅1̲̅)̲̅$ ̲̅] leenster is offline
    MemberRank
    May 2008 Join Date
    KanaadaLocation
    992Posts

    Re: [FIX] Group Gate

    Thanks for fixing that up. Much better now.

  11. #11
    Member Silas R is offline
    MemberRank
    May 2012 Join Date
    51Posts

    Re: [FIX] Group Gate #UPDATE / VERSION 2

    Changelog:
    - Version 2:
    - Now you can enter by 2 sides

  12. #12
    The Legend Returns vista4life is offline
    MemberRank
    Mar 2007 Join Date
    The NetherlandsLocation
    843Posts

    Re: [FIX] Group Gate #UPDATE / VERSION 2

    Quote Originally Posted by Silas R View Post
    Changelog:
    - Version 2:
    - Now you can enter by 2 sides
    It's a nice release but, System.Threading.Thread.Sleep(1000);?

    i wont use this, but thanks.

  13. #13
    Member Silas R is offline
    MemberRank
    May 2012 Join Date
    51Posts

    Re: [FIX] Group Gate #UPDATE / VERSION 2

    Why.?

  14. #14
    Account Upgraded | Title Enabled! Imagician is offline
    MemberRank
    Sep 2010 Join Date
    244Posts

    Re: [FIX] Group Gate #UPDATE / VERSION 2

    Thread.Sleep(1000) = much CPU usage.

  15. #15
    Member Silas R is offline
    MemberRank
    May 2012 Join Date
    51Posts

    Re: [FIX] Group Gate #UPDATE / VERSION 2

    how can i do it better?



Advertisement