Set home_room command

SlopeQ

New Member
Mar 20, 2014
22
2
Hello I am trying to make a command to set the home_room but somehow it does not work. This is the current code and I've tried so MANY combinations of it that I would love to drag my hair of... LoL

This is the current code:
dbClient.RunQuery("UPDATE users SET home_room = '29' WHERE id='" + TargetClient.GetHabbo().Id + "' LIMIT 1");

But that won't update the home_room. I am using the exact same syntax for other commands that uses the database this way and they work. Assuming this is something with the home_room column.
I am using RevCms with Plusemu.

Best Regards!
 

Damon

Member
Aug 13, 2012
364
114
I managed to fiddle around with what you wanted and succeeded.
What exactly was your problem? Was it chucking an error when debugging, or just not not updating when entering the command?

Anyways this is what I used:

Code:
           using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {

                dbClient.RunQuery("UPDATE `users` SET `home_room` = '29' WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
            }
            StringBuilder HabboInfo = new StringBuilder();
            HabboInfo.Append("Your home room has successfully been updated");
            Session.SendNotification(HabboInfo.ToString());

Or you can check my whole class here:

Hope this works and helps
 
Last edited:

SlopeQ

New Member
Mar 20, 2014
22
2
I managed to fiddle around with what you wanted and succeeded.
What exactly was your problem? Was it chucking an error when debugging, or just not not updating when entering the command?

Anyways


Code:
           using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {

                dbClient.RunQuery("UPDATE `users` SET `home_room` = '29' WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
            }
            StringBuilder HabboInfo = new StringBuilder();
            HabboInfo.Append("Your home room has successfully been updated");
            Session.SendNotification(HabboInfo.ToString());

Or you can check my whole class here:

Hope this works and helps

Hi, The error was it just wasn't updating. Trying this code now. Thanks alot!
 

SlopeQ

New Member
Mar 20, 2014
22
2
Oh well, hopefully after you use this it works. I ran it, and checked to make sure it worked and it did. So hopefully same result for yourself.

Hi this did not work. :( I am trying to set the home_room on tha TargetUser and not the session. Maybe it's something wrong with that even though it should work?
 

Damon

Member
Aug 13, 2012
364
114
Hi this did not work. :( I am trying to set the home_room on tha TargetUser and not the session. Maybe it's something wrong with that even though it should work?
Oh! My bad!

Do you want it like, :homeroom [username] ? Sorry if its not, Its 4am and pretty tired haha.
If so, this worked for me
Code:
           GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);

            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.RunQuery("UPDATE `users` SET `home_room` = '30' WHERE `id` = '" + TargetClient.GetHabbo().Id + "' LIMIT 1");
            }
            StringBuilder HabboInfo = new StringBuilder();
            HabboInfo.Append(TargetClient.GetHabbo().Username + "'s home room has successfully been updated");
            Session.SendNotification(HabboInfo.ToString());
or full:
 

SlopeQ

New Member
Mar 20, 2014
22
2
Oh! My bad!

Do you want it like, :homeroom [username] ? Sorry if its not, Its 4am and pretty tired haha.
If so, this worked for me
Code:
           GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);

            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.RunQuery("UPDATE `users` SET `home_room` = '30' WHERE `id` = '" + TargetClient.GetHabbo().Id + "' LIMIT 1");
            }
            StringBuilder HabboInfo = new StringBuilder();
            HabboInfo.Append(TargetClient.GetHabbo().Username + "'s home room has successfully been updated");
            Session.SendNotification(HabboInfo.ToString());
or full:

does not work, for me. Very strange. Can I hit you up on skype or something and share my code. I don't want to share it here as this "full" class is a very big thing
 

Users who are viewing this thread

Top