I've always found those commands useful, so I decided to share it with you guys.
eha;
Spoiler:Code:#region Events Hotel Alert (:eha) case "eha": if (Session.GetHabbo().HasCmd("eha")) { string Notice = MergeParams(Params, 1); ServerMessage HotelAlert = new ServerMessage(Outgoing.BroadcastMessage); HotelAlert.AppendString("Follow " + Session.GetHabbo().Username + " to take part in an official Event! Win prizes! \r\n- " + Session.GetHabbo().Username); SilverwaveEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(HotelAlert); SilverwaveEnvironment.GetGame().GetModerationTool().LogStaffEntry(Session.GetHabbo().Username, string.Empty, "HotelAlert", "Hotel alert [" + Notice + "]"); return true; } return true; #endregion
sayall;
Spoiler:
Code:#region Say All (:sayall) case "sayall": if (Session.GetHabbo().HasCmd("sayall")) { Room currentRoom2 = Session.GetHabbo().CurrentRoom; if (currentRoom2 != null) { string Message3 = ChatCommandHandler.MergeParams(Params, 1); if (Message3 != "") { foreach (RoomUser roomUser2 in currentRoom2.GetRoomUserManager().GetRoomUsers()) roomUser2.Chat(roomUser2.GetClient(), Message3, false, 0); } } return true; } else return true; #endregion
:Summonall - Credits to Power69
Spoiler:
Code:case "summonall": { Room currentRoom = Session.GetHabbo().CurrentRoom; List<RoomUser> roomUsers = currentRoom.GetRoomUserManager().GetRoomUsers(); if (Session.GetHabbo().HasCmd("summonall")) { foreach (GameClients.GameClient c in SilverwaveEnvironment.GetGame().GetClientManager().clients.Values) { if (c.GetHabbo() != null) { if (c.GetHabbo().Username == Session.GetHabbo().Username) { Session.SendNotif("You have summoned everyone"); } else { c.GetMessageHandler().PrepareRoomForUser(currentRoom.RoomId, currentRoom.Password); c.SendNotif(Session.GetHabbo().Username + "Has Summoned you"); } } } } return true; }
signall;
Spoiler:
Code:#region case "signall": if (Session.GetHabbo().HasCmd("signall")) { Room currentRoom2 = Session.GetHabbo().CurrentRoom; if (currentRoom2 != null) { int result = 0; if (int.TryParse(Params[1], out result)) { foreach (RoomUser roomUser2 in currentRoom2.GetRoomUserManager().GetRoomUsers()) { roomUser2.AddStatus("sign", Convert.ToString(result)); roomUser2.UpdateNeeded = true; } } } return true; } else return true; #endregion
:sa fix;
Spoiler:
Code:#region Staff Alert (:sa) case "sa": { if (Session.GetHabbo().HasCmd("sa")) { string Message = "Message from staff: \n" + MergeParams(Params, 1) + "\n - " + Session.GetHabbo().Username; ServerMessage message = new ServerMessage(Outgoing.BroadcastMessage); message.AppendString(Message); SilverwaveEnvironment.GetGame().GetClientManager().StaffAlert(message); SilverwaveEnvironment.GetGame().GetModerationTool().LogStaffEntry(Session.GetHabbo().Username, string.Empty, "StaffAlert", "Staff alert [" + Message + "]"); } return true; } #endregion
For those who don't know how to add the commands, the only thing you need to do is copy the code and add it to ChatCommandHandler.cs.
If you like it just hit the like button, If not just leave the thread and move on.



Reply With Quote



