Hello ragezone, today i coded something!
How to add?
Goto RoomManager.cs
Place these void in there:
Goto Messages -> Users.csCode: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; }
Add to the voids Range:
Add to the handlersrange: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!"); } } }
Code:RequestHandlers[482] = new RequestHandler(FindFriends);





