• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[SERVICE] - Coding Commands

Status
Not open for further replies.
Experienced Elementalist
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.
 
LETS REACH 666 POSTS?!!!!
Joined
Apr 24, 2013
Messages
573
Reaction score
53
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
 
Experienced Elementalist
Joined
Nov 16, 2009
Messages
204
Reaction score
12
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? ;)
 
LETS REACH 666 POSTS?!!!!
Joined
Apr 24, 2013
Messages
573
Reaction score
53
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 right ;) thats 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)
 
Experienced Elementalist
Joined
Nov 16, 2009
Messages
204
Reaction score
12
Ah yeah ur right ;) thats 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)

:limitrights would be hard to code, lol
 
Experienced Elementalist
Joined
Aug 26, 2012
Messages
248
Reaction score
49
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!


will do these now :)
Allow Rights!
PHP:
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");
            }
        }
Moonwalkall
PHP:
   internal void moonwalkall()
        {
            Room currentRoom = this.Session.GetHabbo().CurrentRoom;
            
            List<RoomUser> roomUsers = currentRoom.GetRoomUserManager().GetRoomUsers();
            foreach (RoomUser user in roomUsers)
            {
                user.moonwalkEnabled = true;
            }

        }
freezeall
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 convert :) dont forget to chatcommandregistery and command.ini and commandsregister.ini


Thats all im doing for today :) here you go Droppy and Pro
 
Last edited:
LETS REACH 666 POSTS?!!!!
Joined
Apr 24, 2013
Messages
573
Reaction score
53
will do these now :)
Allow Rights!
PHP:
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");
            }
        }
Moonwalkall
PHP:
   internal void moonwalkall()
        {
            Room currentRoom = this.Session.GetHabbo().CurrentRoom;
            
            List<RoomUser> roomUsers = currentRoom.GetRoomUserManager().GetRoomUsers();
            foreach (RoomUser user in roomUsers)
            {
                user.moonwalkEnabled = true;
            }

        }
freezeall
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 convert :) dont forget to chatcommandregistery and command.ini and commandsregister.ini


Thats all im doing for today :) here 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
Emulator


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?
 
Last edited:
Experienced Elementalist
Joined
Aug 26, 2012
Messages
248
Reaction score
49
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 :)
 
LETS REACH 666 POSTS?!!!!
Joined
Apr 24, 2013
Messages
573
Reaction score
53
Because freeze doesn't even work. :p It gives you ice skates and a bunny car if you click enough.

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
 
Experienced Elementalist
Joined
Aug 26, 2012
Messages
248
Reaction score
49
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;
                }
            }
 
Banned
Banned
Joined
Apr 11, 2013
Messages
48
Reaction score
10
Yes, that'll be asking if your id is the users id, if so do this.. which it's listing all users in room?
 
Joined
Apr 24, 2013
Messages
1,685
Reaction score
1,135
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
Then idk about the freeze. About the roombuilder, I'll contact you in private.
 
Experienced Elementalist
Joined
Aug 26, 2012
Messages
248
Reaction score
49
Yes, that'll be asking if your id is the users id, if so do this.. which it's listing all users in room?
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)
                {
                    
                }
else
{
user.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(effectId);
                    user.CanWalk = false;
}
            }  
}

Working freezeall and doesnt freeze the person making the command :)
 
Status
Not open for further replies.
Back
Top