- Joined
- Nov 16, 2009
- Messages
- 204
- Reaction score
- 12
I'll repeat my previous post hoping that someone will respond with a quote!
Can someone make a command for a room owner to make it so everyone has rights allowed?![]()
That would be nice, tbh.
I'll repeat my previous post hoping that someone will respond with a quote!
Can someone make a command for a room owner to make it so everyone has rights allowed?![]()
I'll repeat my previous post hoping that someone will respond with a quote!
Can someone make a command for a room owner to make it so everyone has rights allowed?![]()
Its a good idea but poeple will totally mess with it and ruin poeple's rooms
It's up to the room owner if he wanna use it. What if he wanted to make it a donate room?![]()
Ah yeah ur rightthats not such a bad idea then,
Also another handy idea than
:allplace
(all users can place, but not move items in a room)
:FreezeAll
([staff] can make everyone freeze)
:limitrights (users rights go away after they moved or placed X tings)
no it wouldn't im going out tonight ill do them all tomorrow:limitrights would be hard to code, lol
no it wouldn't im going out tonight ill do them all tomorrow
why dont you make some commands like allmoonwalk, everybody in room moonwalks, etc
I hope you don't forget the command ":freerights on/off" or whatever command name you see fitting for a command that allows rights for everyone in the room
Thank you and have a great time!
internal void allowrights()
{
Room room = this.Session.GetHabbo().CurrentRoom; // Current Room
string on = this.Params[1]; // On / Off
if (room.OwnerId == Session.GetHabbo().Id) // if room owner
{
if (on == "On")
{
foreach (GameClients.GameClient c in ButterflyEnvironment.GetGame().GetClientManager().clients.Values)
{
if (c.GetHabbo() != null)
{
uint pId = c.GetHabbo().Id;
RoomUser roomUserByHabbo = room.GetRoomUserManager().GetRoomUserByHabbo(pId);
if (c.GetHabbo().Username == Session.GetHabbo().Username)
{
}
else
{
room.UsersWithRights.Add(pId);
using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
adapter.runFastQuery(string.Concat(new object[] { "INSERT INTO room_rights (room_id,user_id) VALUES (", room.RoomId, ",", pId, ")" }));
}
c.GetMessageHandler().GetResponse().Init(Outgoing.GivePowers);
c.GetMessageHandler().GetResponse().AppendInt32(room.RoomId);
c.GetMessageHandler().GetResponse().AppendInt32(pId);
c.GetMessageHandler().GetResponse().AppendString(roomUserByHabbo.GetClient().GetHabbo().Username);
c.GetMessageHandler().SendResponse();
ServerMessage message = new ServerMessage(Outgoing.RoomRightsLevel);
message.AppendInt32(1);
roomUserByHabbo.GetClient().SendMessage(message);
roomUserByHabbo.RemoveStatus("flatctrl 0");
roomUserByHabbo.AddStatus("flatctrl 1", "");
roomUserByHabbo.UpdateNeeded = true;
}
}
}
}
else if ((on == "Off"))
{
foreach (GameClients.GameClient i in ButterflyEnvironment.GetGame().GetClientManager().clients.Values)
{
if (i.GetHabbo() != null)
{
uint pId = i.GetHabbo().Id;
RoomUser roomUserByHabbo = room.GetRoomUserManager().GetRoomUserByHabbo(pId);
if (i.GetHabbo().Username == Session.GetHabbo().Username)
{
}
else
{
room.UsersWithRights.Remove(pId);
using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
adapter.runFastQuery(string.Concat(new object[] { "DELETE FROM room_rights WHERE room_id = '", room.RoomId, "' AND user_id = '", pId, "'" }));
}
i.GetMessageHandler().GetResponse().Init(Outgoing.RemovePowers);
i.GetMessageHandler().GetResponse().AppendInt32(room.RoomId);
i.GetMessageHandler().GetResponse().AppendInt32(pId);
i.GetMessageHandler().SendResponse();
ServerMessage message = new ServerMessage(Outgoing.RoomRightsLevel);
message.AppendInt32(1);
roomUserByHabbo.GetClient().SendMessage(message);
roomUserByHabbo.RemoveStatus("flatctrl 1");
roomUserByHabbo.AddStatus("flatctrl 0", "");
roomUserByHabbo.UpdateNeeded = true;
}
}
}
}
else
{
Session.SendNotif("Please Type On or Off");
}
}
else
{
Session.SendNotif("Your not the Room Owner");
}
}
internal void moonwalkall()
{
Room currentRoom = this.Session.GetHabbo().CurrentRoom;
List<RoomUser> roomUsers = currentRoom.GetRoomUserManager().GetRoomUsers();
foreach (RoomUser user in roomUsers)
{
user.moonwalkEnabled = true;
}
}
internal void freezeall()
{
Room currentRoom = this.Session.GetHabbo().CurrentRoom;
int effectId = 12;
List<RoomUser> roomUsers = currentRoom.GetRoomUserManager().GetRoomUsers();
foreach (RoomUser user in roomUsers)
{
if (Session.GetHabbo().Id != user.userID)
{
user.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(effectId);
user.CanWalk = false;
}
}
}
will do these now
Allow Rights!
MoonwalkallPHP:internal void allowrights() { Room room = this.Session.GetHabbo().CurrentRoom; // Current Room string on = this.Params[1]; // On / Off if (room.OwnerId == Session.GetHabbo().Id) // if room owner { if (on == "On") { foreach (GameClients.GameClient c in ButterflyEnvironment.GetGame().GetClientManager().clients.Values) { if (c.GetHabbo() != null) { uint pId = c.GetHabbo().Id; RoomUser roomUserByHabbo = room.GetRoomUserManager().GetRoomUserByHabbo(pId); if (c.GetHabbo().Username == Session.GetHabbo().Username) { } else { room.UsersWithRights.Add(pId); using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor()) { adapter.runFastQuery(string.Concat(new object[] { "INSERT INTO room_rights (room_id,user_id) VALUES (", room.RoomId, ",", pId, ")" })); } c.GetMessageHandler().GetResponse().Init(Outgoing.GivePowers); c.GetMessageHandler().GetResponse().AppendInt32(room.RoomId); c.GetMessageHandler().GetResponse().AppendInt32(pId); c.GetMessageHandler().GetResponse().AppendString(roomUserByHabbo.GetClient().GetHabbo().Username); c.GetMessageHandler().SendResponse(); ServerMessage message = new ServerMessage(Outgoing.RoomRightsLevel); message.AppendInt32(1); roomUserByHabbo.GetClient().SendMessage(message); roomUserByHabbo.RemoveStatus("flatctrl 0"); roomUserByHabbo.AddStatus("flatctrl 1", ""); roomUserByHabbo.UpdateNeeded = true; } } } } else if ((on == "Off")) { foreach (GameClients.GameClient i in ButterflyEnvironment.GetGame().GetClientManager().clients.Values) { if (i.GetHabbo() != null) { uint pId = i.GetHabbo().Id; RoomUser roomUserByHabbo = room.GetRoomUserManager().GetRoomUserByHabbo(pId); if (i.GetHabbo().Username == Session.GetHabbo().Username) { } else { room.UsersWithRights.Remove(pId); using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor()) { adapter.runFastQuery(string.Concat(new object[] { "DELETE FROM room_rights WHERE room_id = '", room.RoomId, "' AND user_id = '", pId, "'" })); } i.GetMessageHandler().GetResponse().Init(Outgoing.RemovePowers); i.GetMessageHandler().GetResponse().AppendInt32(room.RoomId); i.GetMessageHandler().GetResponse().AppendInt32(pId); i.GetMessageHandler().SendResponse(); ServerMessage message = new ServerMessage(Outgoing.RoomRightsLevel); message.AppendInt32(1); roomUserByHabbo.GetClient().SendMessage(message); roomUserByHabbo.RemoveStatus("flatctrl 1"); roomUserByHabbo.AddStatus("flatctrl 0", ""); roomUserByHabbo.UpdateNeeded = true; } } } } else { Session.SendNotif("Please Type On or Off"); } } else { Session.SendNotif("Your not the Room Owner"); } }
freezeallPHP:internal void moonwalkall() { Room currentRoom = this.Session.GetHabbo().CurrentRoom; List<RoomUser> roomUsers = currentRoom.GetRoomUserManager().GetRoomUsers(); foreach (RoomUser user in roomUsers) { user.moonwalkEnabled = true; } }
PHP:internal void freezeall() { Room currentRoom = this.Session.GetHabbo().CurrentRoom; int effectId = 12; List<RoomUser> roomUsers = currentRoom.GetRoomUserManager().GetRoomUsers(); foreach (RoomUser user in roomUsers) { if (Session.GetHabbo().Id != user.userID) { user.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(effectId); user.CanWalk = false; } } }
(any bcstorm edit) dont have my plus emu on this computer to code it for plus cant be to hard to convertdont forget to chatcommandregistery and command.ini and commandsregister.ini
Thats all im doing for todayhere you go @Droppy and @Pro
Im getting this error?
Error 1 'Butterfly.HabboHotel.GameClients.GameClientManager.clients' is inaccessible due to its protection level C:\Users\MYPC\Emulator\Butterfly\HabboHotel\Misc\ChatCommandHandler.cs 1261 108 Butterfly
EDIT:
FIX:
change
private Dictionary<uint, GameClient> clients = new Dictionary<uint, GameClient>();
to
internal Dictionary<uint, GameClient> clients = new Dictionary<uint, GameClient>();
Is this safe to do?
I changed it to public![]()
Because freeze doesn't even work.
Eehm, FreezeAll isnt working for me?
Did u test it?
:moonwalkall does work
Because freeze doesn't even work.It gives you ice skates and a bunny car if you click enough.
internal void freezeall()
{
Room currentRoom = this.Session.GetHabbo().CurrentRoom;
int effectId = 12;
List<RoomUser> roomUsers = currentRoom.GetRoomUserManager().GetRoomUsers();
foreach (RoomUser user in roomUsers)
{
if (Session.GetHabbo().Id == user.userID)
{
user.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(effectId);
user.CanWalk = false;
}
}
Then idk about the freeze. About the roombuilder, I'll contact you in private.ONT
Freezeall is a :Freeze for everyone so it shouldnt have annytig to do with that i geuss
OFFT
Btw may i ask if you use:
room_model_customs for your roombuilder?
Becouse if i add one there and put the room model on custom the room doesnt load
Yes, that'll be asking if your id is the users id, if so do this.. which it's listing all users in room?
internal void freezeall()
{
Room currentRoom = this.Session.GetHabbo().CurrentRoom;
int effectId = 12;
List<RoomUser> roomUsers = currentRoom.GetRoomUserManager().GetRoomUsers();
foreach (RoomUser user in roomUsers)
{
if (Session.GetHabbo().Id != user.userID)
{
}
else
{
user.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(effectId);
user.CanWalk = false;
}
}
}