I was trying some things, and coded the "Mute all" button in room settings (it's functioning like a roommute);
Add to Incomming.cs somewhere in the first part:
Code:
public static int AlgemeenSpreekverbodIn;
In the second part this:
Code:
Incoming.AlgemeenSpreekverbodIn = 574;
In Outgoing.cs add this in the first part:
Code:
public static int AlgemeenSpreekverbodKnop;
And this in the second part:
Code:
Outgoing.AlgemeenSpreekverbodKnop = 2132;
In StaticClientMessageHandler.cs in the RegisterPacketLibary void add this:
Code:
handlers.Add(Incoming.AlgemeenSpreekverbodIn, new StaticRequestHandler(SharedPacketLib.AlgemeenSpreekverbodIn));
In SharedPacketLib.cs add this in the SharedPacketLib:
Code:
internal static void AlgemeenSpreekverbodIn(GameClientMessageHandler handler)
{
handler.AlgemeenSpreekverbodIn();
}
Add this void to your GameClientMessageHandler.cs (above //furnimatic or something):
Code:
internal void AlgemeenSpreekverbodIn()
{
Room currentRoom = this.Session.GetHabbo().CurrentRoom;
if (this.Session.GetHabbo().CurrentRoom.RoomMuted)
{
this.Session.GetHabbo().CurrentRoom.RoomMuted = false;
ServerMessage Message = new ServerMessage(Outgoing.AlgemeenSpreekverbodKnop);
Message.AppendBoolean(false);
Session.SendMessage(Message);
return;
}
else
{
this.Session.GetHabbo().CurrentRoom.RoomMuted = true;
ServerMessage Message = new ServerMessage(Outgoing.AlgemeenSpreekverbodKnop);
Message.AppendBoolean(true);
Session.SendMessage(Message);
return;
}
}
When you click, it will mute the room and change the text to "Unmute all" (or something), when you click again it will unmute the room and change the text back to "Mute all".
If you want to improve, feel free
. I know the packet names are in Dutch (because I'm from Belgium), that's just Ducth for General Mute
.
- Matthias