FriendBar: GetFriends 100%

Results 1 to 18 of 18
  1. #1
    Account Upgraded | Title Enabled! wichard is offline
    MemberRank
    Jul 2009 Join Date
    The NetherlandsLocation
    649Posts

    FriendBar: GetFriends 100%

    Hello ragezone, today i coded something!

    How to add?

    Goto RoomManager.cs

    Place these void in there:

    Code:
            public int GetRandom(int min, int max)
            {
                Random Random = new Random();
                return Random.Next(min, max);
            }
    
            public uint GetRandomRoomIdWithUser(GameClient Session)
            {
                List<uint> Roomer = new List<uint>();
    
                lock (this.Rooms)
                {
                    foreach (Room Room in this.Rooms.Values)
                    {
                        if (Room.RoomId == Session.GetHabbo().CurrentRoomId)
                            continue;
    
                        if (Room.UserCount > 0 && Room.Password == "")
                        {
                            Roomer.Add(Room.RoomId);
                        }
                    }
                }
    
                uint RoomId = 0;
    
                if (Roomer.Count > 0)
                {
                    int i = GetRandom(0, Roomer.Count);
    
                    RoomId = Roomer[i];
                }
    
                return RoomId;
            }
    Goto Messages -> Users.cs

    Add to the voids Range:

    Code:
            public void FindFriends()
            {
                if (Request.ToString().Contains("find_friends_btn_click"))
                {
                    uint RoomId = UberEnvironment.GetGame().GetRoomManager().GetRandomRoomIdWithUser(Session); // Session = no current room =)
    
                    if (RoomId != 0)
                    {                    Session.GetMessageHandler().PrepareRoomForUser(RoomId, "");
                        Session.SendNotif("Click on a user to add him/her to your friendlist!");
                    }
                    else
                    {
                        Session.SendNotif("There are no rooms to enter!");
                    }
                }
            }
    Add to the handlersrange:

    Code:
                RequestHandlers[482] = new RequestHandler(FindFriends);
    Last edited by wichard; 10-04-11 at 03:25 PM.


  2. #2
    Account Upgraded | Title Enabled! simoneihg is offline
    MemberRank
    Dec 2010 Join Date
    PalermoLocation
    243Posts

    Re: FriendBar: GetFriends 100%

    Thanks!!

  3. #3
    Enthusiast Rocksmurf is offline
    MemberRank
    Jan 2011 Join Date
    28Posts

    Re: FriendBar: GetFriends 100%

    The type or namespace name Safelist could not be found?
    Last edited by Rocksmurf; 10-04-11 at 03:05 PM.

  4. #4
    Account Upgraded | Title Enabled! Miggs is offline
    MemberRank
    Oct 2010 Join Date
    711Posts

    Re: FriendBar: GetFriends 100%

    Very nice :D

  5. #5
    Enthusiast dimitri54480 is offline
    MemberRank
    Feb 2011 Join Date
    44Posts

    Re: FriendBar: GetFriends 100%

    Quote Originally Posted by Rocksmurf View Post
    The type or namespace name Safelist could not be found?
    I have too the problem, the code isn't work

  6. #6
    Account Upgraded | Title Enabled! wichard is offline
    MemberRank
    Jul 2009 Join Date
    The NetherlandsLocation
    649Posts

    Re: FriendBar: GetFriends 100%

    fixed

  7. #7
    Enthusiast dimitri54480 is offline
    MemberRank
    Feb 2011 Join Date
    44Posts

    Re: FriendBar: GetFriends 100%

    thank you :p
    Have you Got achievement system r59 + ? i search it

  8. #8
    Account Upgraded | Title Enabled! wichard is offline
    MemberRank
    Jul 2009 Join Date
    The NetherlandsLocation
    649Posts

    Re: FriendBar: GetFriends 100%

    yea i got it, i dont help just think about that =)

  9. #9
    Banned PEjump2 is offline
    BannedRank
    Jan 2010 Join Date
    The NetherlandsLocation
    2,838Posts

    Re: FriendBar: GetFriends 100%

    Thanks for releasing, needed this :>

    And eh, little hint:
    PHP Code:
    UberEnvironment.GetRandomNumber(01); 
    Last edited by PEjump2; 10-04-11 at 04:38 PM.

  10. #10
    Account Upgraded | Title Enabled! wichard is offline
    MemberRank
    Jul 2009 Join Date
    The NetherlandsLocation
    649Posts

    Re: FriendBar: GetFriends 100%

    haha lame, didnt knew that xD

  11. #11
    sexiess is a sin. Subway is offline
    MemberRank
    Jun 2010 Join Date
    2,491Posts

    Re: FriendBar: GetFriends 100%

    Thanks bro, will use.

  12. #12
    are you ******* kidding!! capostrike93 is offline
    MemberRank
    Jan 2011 Join Date
    366Posts

    Re: FriendBar: GetFriends 100%

    the code is buggi and not have a good performance..

    use this

    PHP Code:
            public uint RoomRandom(int SkipId)
            {
                
    Random Random = new Random();
                
    int i = -1;
                do
                {
                    
    Random.Next(0Rooms.Count-1);
                }
                while (
    Rooms[i] == null || Rooms[i].RoomId == SkipId);

                return (
    uint)Rooms[i].RoomId;
            } 
    PHP Code:
        public void FindFriends()
        {
            if (
    Request.ToString().Contains("find_friends_btn_click"))
            {
                
    Session.GetMessageHandler().PrepareRoomForUser(UberEnvironment.GetGame().GetRoomManager().RoomRandom(Session.GetHabbo().CurrentRoomId), "");
            }
        } 

  13. #13
    Proficient Member HabsHotel is offline
    MemberRank
    Jan 2011 Join Date
    CanadaLocation
    167Posts

    Re: FriendBar: GetFriends 100%

    Very nice ;P
    Last edited by HabsHotel; 11-04-11 at 03:23 AM.

  14. #14
    Account Upgraded | Title Enabled! salah-salah is offline
    MemberRank
    Jan 2009 Join Date
    UndergroundLocation
    716Posts

    Re: FriendBar: GetFriends 100%

    Quote Originally Posted by HabsHotel View Post
    Very nice ;P
    Offtopic: Habshotel , hide your hotels IP :)
    Ontopic:Ty needed this.

  15. #15
    Apprentice DaCoderCallum is offline
    MemberRank
    Feb 2011 Join Date
    AustraliaLocation
    7Posts

    Re: FriendBar: GetFriends 100%

    Is this the new chat that habbos has atm??

  16. #16
    Minor Devolper ntl200 is offline
    MemberRank
    Dec 2007 Join Date
    EnglandLocation
    538Posts

    Re: FriendBar: GetFriends 100%

    Quote Originally Posted by DaCoderCallum View Post
    Is this the new chat that habbos has atm??
    its for the friend bar at the bottomof client as far as imaware

  17. #17
    Member Letkiss is offline
    MemberRank
    Jun 2010 Join Date
    83Posts

    Re: FriendBar: GetFriends 100%

    At me don't appears °-°

  18. #18
    Novice Alcarah77 is offline
    MemberRank
    Apr 2011 Join Date
    3Posts

    Re: FriendBar: GetFriends 100%

    And the variables?
    Waht is a text a add to the variables



Advertisement