Welcome to the RaGEZONE - MMORPG development forums.

[ButterFly r96] Sit Command

This is a discussion on [ButterFly r96] Sit Command within the Habbo Releases forums, part of the Habbo Hotel category; I was trying to add Jacobs sit command to the butterfly emu but I found that it needed some editing ...

Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Developer
    Rank
    Member +
    Join Date
    May 2008
    Location
    Kanaada
    Posts
    1,057
    Liked
    772

    [ButterFly r96] Sit Command

    Click
    I was trying to add Jacobs sit command to the butterfly emu but I found that it needed some editing and some additional code to make it work.

    I got it working and will show you how to add it. Maybe this will start the trend of people posting code snippets for Bfly just like they used to do for Uber.

    I know it's a simple release but it works:)

    Alright, lets get started:
    First open system/commands.ini

    At the bottom add:

    PHP Code:
    [sit]
    sit.minrank=1
    sit
    .description=Makes your avatar sit
    sit
    .prefix=
    sit.input=sit
    sit
    .clubs
    Now open system/commands_register.ini

    At the bottom add:
    PHP Code:
    sit=69 
    Open ChatCommandRegister.cs and find:
    PHP Code:
    case 68:
                        {
                            
    commandHandler.Fly();
                            break;
                        } 
    Below that add:
    PHP Code:
    case 69:
                        {
                            
    commandHandler.sit();
                            break;
                        } 
    Open ChatCommandHandler.cs and find:
    PHP Code:
    #region Commands 
    Below that add:
    PHP Code:
    internal void sit()
            {
                
    Room TargetRoom Session.GetHabbo().CurrentRoom;
                
    RoomUser TargetRoomUser null;
                
    int tries 0;
                
    TargetRoom ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

                
    TargetRoomUser TargetRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

                if (!
    TargetRoomUser.Statusses.ContainsKey("sit"))
                {
                    if ((
    TargetRoomUser.RotBody 2) == 0)
                    {
                        if (
    TargetRoomUser == null)
                        {
                            return;
                        }

                        try
                        {
                            
    TargetRoomUser.Statusses.Add("sit""1.0");
                            
    TargetRoomUser.-= 0.35;
                            
    TargetRoomUser.isSitting true;
                            
    TargetRoomUser.UpdateNeeded true;
                        }
                        catch { }

                        return;

                    }

                    else
                    {
                        if (
    tries <= 1)
                        {
                            
    TargetRoomUser.RotBody--;
                            
    tries++;
                            
    sit();
                        }
                        else
                        {
                            
    Session.SendNotif("You cannot sit diagonally, try it again please");
                            
    tries 0;
                        }

                    }

                }

                else if (
    TargetRoomUser.isSitting == true)
                {
                    
                        
    TargetRoomUser.+= 0.35;
                        
    TargetRoomUser.Statusses.Remove("sit");
                        
    TargetRoomUser.Statusses.Remove("1.0");
                        
    TargetRoomUser.isSitting false;
                        
    TargetRoomUser.UpdateNeeded true;

                }
            } 
    Open RoomUser.cs and find:
    PHP Code:
    internal bool isFlying false
    Below that add:
    PHP Code:
    internal bool isSitting false
    Now open RoomUserManagaer.cs and find:
    PHP Code:
    double nextZ room.GetGameMap().SqAbsoluteHeight(nextXnextY); 
    Below that add:
    PHP Code:
          if (User.isSitting == true)
                            {

                                    
    User.Statusses.Remove("sit");
                                    
    User.+= 0.35;
                                    
    User.isSitting false;
                                    
    User.UpdateNeeded true;
                                
                                
                            } 
    Credits to T09 for fixing it up a little.

    I think that's about it :)
    Don't flame I know it's simple.
    Last edited by leenster; 03-07-12 at 02:06 AM.

  2. #2
    Member
    Rank
    Member
    Join Date
    Apr 2011
    Location
    Blackburn
    Posts
    60
    Liked
    6

    Re: [ButterFly r96] Sit Command

    Nice release
    Last edited by CobraSnip; 05-07-12 at 04:46 AM.

  3. #3
    @_Prizm
    Rank
    Subscriber
    Join Date
    Feb 2012
    Location
    Denmark
    Posts
    2,144
    Liked
    522
    PSN ID: InfraRedDude Steam ID: lehprizm

    Re: [ButterFly r96] Sit Command

    Thanks Leenster! Going to add it now Butterfly FTW!
    Edit: got it to work :P
    Last edited by PRIZM; 29-06-12 at 05:46 AM.

  4. #4
    son, i am dissapoint
    Rank
    Member +
    Join Date
    Sep 2009
    Location
    The Netherlands
    Posts
    516
    Liked
    161

    Re: [ButterFly r96] Sit Command

    It's nice that you're contributing really. But still, that sit command is kinda stupid.. sitting in the air?
    Want to re-live the oldschool Habbo experience? Play Wobble? Use the camera?
    Visit puddihotel.net for a change.

  5. #5
    Account Upgraded | Title Enabled!
    Rank
    Member +
    Join Date
    Jul 2009
    Posts
    198
    Liked
    19

    Re: [ButterFly r96] Sit Command

    I fixed wired for butterfly and a good catalogue

    demo: rabbo-hotel.nl

  6. #6
    - MichaelMadman
    Rank
    Subscriber
    Join Date
    Aug 2011
    Posts
    388
    Liked
    251

    Re: [ButterFly r96] Sit Command

    Quote Originally Posted by Near View Post
    It's nice that you're contributing really. But still, that sit command is kinda stupid.. sitting in the air?
    No... Sitting on the floor... Habbo has it.
    Liam likes this.

  7. #7
    Dwight Schrute
    Rank
    Subscriber
    Join Date
    May 2011
    Posts
    253
    Liked
    65

    Re: [ButterFly r96] Sit Command

    Thank you very much. I hope people will keep posting things like this to Butterfly :)

  8. #8
    son, i am dissapoint
    Rank
    Member +
    Join Date
    Sep 2009
    Location
    The Netherlands
    Posts
    516
    Liked
    161

    Re: [ButterFly r96] Sit Command

    Quote Originally Posted by SkeetEmUp View Post
    No... Sitting on the floor... Habbo has it.
    Oh really? Well, didn't really know that. On the screen it looked like he was sitting in the air, haha. Thanks mate.
    Want to re-live the oldschool Habbo experience? Play Wobble? Use the camera?
    Visit puddihotel.net for a change.

  9. #9
    @_Prizm
    Rank
    Subscriber
    Join Date
    Feb 2012
    Location
    Denmark
    Posts
    2,144
    Liked
    522
    PSN ID: InfraRedDude Steam ID: lehprizm

    Re: [ButterFly r96] Sit Command

    What about making addons to Butterfly?

  10. #10
    Erday im hustlin
    Rank
    Member +
    Join Date
    Dec 2007
    Location
    Sandaygo
    Posts
    588
    Liked
    1

    Re: [ButterFly r96] Sit Command

    Nvm, fixed lol

    EDIT: not fixed, still can't create rooms
    Last edited by Bapestar; 29-06-12 at 09:13 AM.
    .


  11. #11
    I'm not gay<3
    Rank
    Member +
    Join Date
    Nov 2011
    Location
    Denmark
    Posts
    196
    Liked
    42

    Re: [ButterFly r96] Sit Command

    Quote Originally Posted by Lasse View Post
    Thanks Leenster! Going to add it now Butterfly FTW!
    Edit: got it to work :P
    Stop using my look. blah

  12. #12
    @_Prizm
    Rank
    Subscriber
    Join Date
    Feb 2012
    Location
    Denmark
    Posts
    2,144
    Liked
    522
    PSN ID: InfraRedDude Steam ID: lehprizm

    Re: [ButterFly r96] Sit Command

    Quote Originally Posted by wizcsharp View Post
    Stop using my look. blah
    Lol, i knew you would say that :p Just used your account from the db to test it. Also created a new one WITHOUT YOUR LOOK :D

  13. #13
    T09
    Learning C#
    Rank
    Member +
    Join Date
    Oct 2011
    Location
    The Netherlands
    Posts
    219
    Liked
    33
    Gamertag: Recoated

    Re: [ButterFly r96] Sit Command

    I fixed the code to be working fine (if you stand on a platform you'll sit at that height, you can't stand on chairs, adapted sit height), I only get credits for the small modifications. Tutorial and bfly compability go to leenster and base goes to jacob.

    Remove all of his code and do the following:

    First open system/commands.ini

    At the bottom add:

    PHP Code:
    [sit]
    sit.minrank=1
    sit
    .description=Makes your avatar sit
    sit
    .prefix=
    sit.input=sit
    sit
    .clubs
    Now open system/commands_register.ini

    At the bottom add:
    PHP Code:
    sit=69 
    Open ChatCommandRegister.cs and find:
    PHP Code:
    case 68:
                        {
                            
    commandHandler.Fly();
                            break;
                        } 
    Below that add:
    PHP Code:
    case 69:
                        {
                            
    commandHandler.sit();
                            break;
                        } 
    Open ChatCommandHandler.cs and find:
    PHP Code:
    #region Commands 
    Below that add:
    PHP Code:
    internal void sit()
            {
                
    InitTimer();
                
    Room TargetRoom Session.GetHabbo().CurrentRoom;
                
    RoomUser TargetRoomUser null;
                
    int tries 0;
                
    TargetRoom ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

                
    TargetRoomUser TargetRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

                if (!
    TargetRoomUser.Statusses.ContainsKey("sit"))
                {
                    if ((
    TargetRoomUser.RotBody 2) == 0)
                    {
                        if (
    TargetRoomUser == null)
                        {
                            return;
                        }

                        try
                        {
                            
    TargetRoomUser.Statusses.Add("sit""1.0");
                            
    TargetRoomUser.-= 0.35;
                            
    TargetRoomUser.isSitting true;
                            
    TargetRoomUser.UpdateNeeded true;
                        }
                        catch { }

                        return;

                    }

                    else
                    {
                        if (
    tries <= 1)
                        {
                            
    TargetRoomUser.RotBody--;
                            
    tries++;
                            
    sit();
                        }
                        else
                        {
                            
    Session.SendNotif("You cannot sit diagonally, try it again please");
                            
    tries 0;
                        }

                    }

                }

                else if (
    TargetRoomUser.isSitting == true)
                {
                    
                        
    TargetRoomUser.+= 0.35;
                        
    TargetRoomUser.Statusses.Remove("sit");
                        
    TargetRoomUser.Statusses.Remove("1.0");
                        
    TargetRoomUser.isSitting false;
                        
    TargetRoomUser.UpdateNeeded true;

                }
            }
           

            private 
    Timer timer1;
            public 
    void InitTimer()
            {
                
    timer1 = new Timer();
                
    timer1.Tick += new EventHandler(timer1_Tick);
                
    timer1.Interval 1000// in miliseconds
                
    timer1.Start();
            }

            private 
    void timer1_Tick(object senderEventArgs e)
            {
                
    isSitting();
            }
            
    internal void isSitting()
            {
                
    Room TargetRoom Session.GetHabbo().CurrentRoom;
                
    RoomUser TargetRoomUser null;
                
    TargetRoom ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

                
    TargetRoomUser TargetRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

                if (
    TargetRoomUser.isSitting == true && !TargetRoomUser.Statusses.ContainsKey("sit"))
                {
                    
    TargetRoomUser.isSitting false;
                }
            } 
    Open RoomUser.cs and find:
    PHP Code:
    internal bool isFlying false
    Below that add:
    PHP Code:
    internal bool isSitting false
    Now open RoomUserManagaer.cs and find:
    PHP Code:
    double nextZ room.GetGameMap().SqAbsoluteHeight(nextXnextY); 
    Below that add:
    PHP Code:
          if (User.isSitting == true)
                            {

                                    
    User.Statusses.Remove("sit");
                                    
    User.+= 0.35;
                                    
    User.isSitting false;
                                    
    User.UpdateNeeded true;
                                
                                
                            } 

    Website: http://T09.nl
    Skype: T09.nl
    MSN: arh-t09@live.com


  14. #14
    Developer
    Rank
    Member +
    Join Date
    May 2008
    Location
    Kanaada
    Posts
    1,057
    Liked
    772

    Re: [ButterFly r96] Sit Command

    Quote Originally Posted by T09 View Post
    Spoiler:

    I fixed the code to be working fine (if you stand on a platform you'll sit at that height, you can't stand on chairs, adapted sit height), I only get credits for the small modifications. Tutorial and bfly compability go to leenster and base goes to jacob.

    Remove all of his code and do the following:

    First open system/commands.ini

    At the bottom add:

    PHP Code:
    [sit]
    sit.minrank=1
    sit
    .description=Makes your avatar sit
    sit
    .prefix=
    sit.input=sit
    sit
    .clubs
    Now open system/commands_register.ini

    At the bottom add:
    PHP Code:
    sit=69 
    Open ChatCommandRegister.cs and find:
    PHP Code:
    case 68:
                        {
                            
    commandHandler.Fly();
                            break;
                        } 
    Below that add:
    PHP Code:
    case 69:
                        {
                            
    commandHandler.sit();
                            break;
                        } 
    Open ChatCommandHandler.cs and find:
    PHP Code:
    #region Commands 
    Below that add:
    PHP Code:
    internal void sit()
            {
                
    InitTimer();
                
    Room TargetRoom Session.GetHabbo().CurrentRoom;
                
    RoomUser TargetRoomUser null;
                
    int tries 0;
                
    TargetRoom ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

                
    TargetRoomUser TargetRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

                if (!
    TargetRoomUser.Statusses.ContainsKey("sit"))
                {
                    if ((
    TargetRoomUser.RotBody 2) == 0)
                    {
                        if (
    TargetRoomUser == null)
                        {
                            return;
                        }

                        try
                        {
                            
    TargetRoomUser.Statusses.Add("sit""1.0");
                            
    TargetRoomUser.-= 0.35;
                            
    TargetRoomUser.isSitting true;
                            
    TargetRoomUser.UpdateNeeded true;
                        }
                        catch { }

                        return;

                    }

                    else
                    {
                        if (
    tries <= 1)
                        {
                            
    TargetRoomUser.RotBody--;
                            
    tries++;
                            
    sit();
                        }
                        else
                        {
                            
    Session.SendNotif("You cannot sit diagonally, try it again please");
                            
    tries 0;
                        }

                    }

                }

                else if (
    TargetRoomUser.isSitting == true)
                {
                    
                        
    TargetRoomUser.+= 0.35;
                        
    TargetRoomUser.Statusses.Remove("sit");
                        
    TargetRoomUser.Statusses.Remove("1.0");
                        
    TargetRoomUser.isSitting false;
                        
    TargetRoomUser.UpdateNeeded true;

                }
            }
           

            private 
    Timer timer1;
            public 
    void InitTimer()
            {
                
    timer1 = new Timer();
                
    timer1.Tick += new EventHandler(timer1_Tick);
                
    timer1.Interval 1000// in miliseconds
                
    timer1.Start();
            }

            private 
    void timer1_Tick(object senderEventArgs e)
            {
                
    isSitting();
            }
            
    internal void isSitting()
            {
                
    Room TargetRoom Session.GetHabbo().CurrentRoom;
                
    RoomUser TargetRoomUser null;
                
    TargetRoom ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

                
    TargetRoomUser TargetRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

                if (
    TargetRoomUser.isSitting == true && !TargetRoomUser.Statusses.ContainsKey("sit"))
                {
                    
    TargetRoomUser.isSitting false;
                }
            } 
    Open RoomUser.cs and find:
    PHP Code:
    internal bool isFlying false
    Below that add:
    PHP Code:
    internal bool isSitting false
    Now open RoomUserManagaer.cs and find:
    PHP Code:
    double nextZ room.GetGameMap().SqAbsoluteHeight(nextXnextY); 
    Below that add:
    PHP Code:
          if (User.isSitting == true)
                            {

                                    
    User.Statusses.Remove("sit");
                                    
    User.+= 0.35;
                                    
    User.isSitting false;
                                    
    User.UpdateNeeded true;
                                
                                
                            } 
    Thanks for fixing it up. I will change the main post and add credits.

  15. #15
    T09
    Learning C#
    Rank
    Member +
    Join Date
    Oct 2011
    Location
    The Netherlands
    Posts
    219
    Liked
    33
    Gamertag: Recoated
    Quote Originally Posted by leenster View Post
    Thanks for fixing it up. I will change the main post and add credits.
    I'll post an improved one tomorrow as the timer is unneeded and I cleaner up some code

    Website: http://T09.nl
    Skype: T09.nl
    MSN: arh-t09@live.com


 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •