Are this for uber?
This is a discussion on Snowlight Coins & GiveBadge Command within the Habbo Releases forums, part of the Habbo Hotel category; Hi, I'm not really good at C# yet, but I'll release it just for others. Search for: Code: case "update_catalog": ...

Hi, I'm not really good at C# yet, but I'll release it just for others.
Search for:
Put BOFORE this command:Code:case "update_catalog":
And after this:Code:case "givebadge": { if (!Session.HasRight("hotel_admin")) { return false; } string Username = UserInputFilter.FilterString(Bits[1].Trim()); Session TargetSession = SessionManager.GetSessionByCharacterId(CharacterResolverCache.GetUidFromName(Username)); if (TargetSession == null) { Session.SendData(UserAlertModernComposer.Compose("Badges", "You need to give a valid user.")); return false; } if (Bits[2].Trim() == "") { Session.SendData(UserAlertModernComposer.Compose("Badges", "You need to give a badge ID")); } using (SqlDatabaseClient MysqlClient = SqlDatabaseManager.GetClient()) { DataRow row = MysqlClient.ExecuteQueryRow("SELECT * FROM badge_definitions WHERE code = '" + Bits[2].Trim() + "'"); MysqlClient.ExecuteScalar("INSERT INTO badges (user_id, badge_id, source_type) VALUES('" + CharacterResolverCache.GetUidFromName(Username) + "', '" + row["id"] + "', 'static')"); } TargetSession.SendData(RoomUserBadgesComposer.Compose(TargetSession.CharacterId, TargetSession.BadgeCache.EquippedBadges)); TargetSession.SendData(UserAlertModernComposer.Compose("Badges", "You just got a new badge, relog for showing off with it!")); return true; }
I hope you guys like it :)Code:case "coins": { if (!Session.HasRight("hotel_admin")) { return false; } string Username = UserInputFilter.FilterString(Bits[1].Trim()); Session TargetSession = SessionManager.GetSessionByCharacterId(CharacterResolverCache.GetUidFromName(Username)); int coins = -1; string trimmer = Bits[2]; if (!int.TryParse(MergeInputs(Bits, 2), out coins)) { Session.SendData(UserAlertModernComposer.Compose("Credits", "Not an int value")); return false; } if (coins <= 0) { Session.SendData(UserAlertModernComposer.Compose("Credits", "Not an int value")); return false; } if (coins >= 1000000) { Session.SendData(UserAlertModernComposer.Compose("Credits", "Please fill an normal value.")); return false; } int oldcoins = TargetSession.CharacterInfo.CreditsBalance; TargetSession.CharacterInfo.CreditsBalance = oldcoins + coins; TargetSession.SendData(CreditsBalanceComposer.Compose(oldcoins+coins)); using (SqlDatabaseClient MysqlClient = SqlDatabaseManager.GetClient()) { int newcoins = oldcoins + coins; MysqlClient.ExecuteQuerySet("UPDATE characters SET credits_balance = '" + newcoins + "' WHERE id = '" + CharacterResolverCache.GetUidFromName(Username) + "' LIMIT 1"); } TargetSession.SendData(UserAlertModernComposer.Compose("Credit","Your credit balance is updated, check it!")); return true; }
Regards,
BetterWay
EDIT:
For the GiveBadge command, you NEED to add all badge codes (likes JKR/SG4 etc.) into your database table badge_definitions..
Are this for uber?
Like the title says, SnowLight Emulator.
So no it isn't for Uber, sorry.
Fix for Givebadge command (U dont need to add badge_definitions now):
Code:case "givebadge": { if (!Session.HasRight("hotel_admin")) { return false; } string Username = UserInputFilter.FilterString(Bits[1].Trim()); Session TargetSession = SessionManager.GetSessionByCharacterId(CharacterResolverCache.GetUidFromName(Username)); if (TargetSession == null) { Session.SendData(UserAlertModernComposer.Compose("Badges", "You need to give a valid user.")); return false; } if (Bits[2].Trim() == "") { Session.SendData(UserAlertModernComposer.Compose("Badges", "You need to give a badge ID")); } using (SqlDatabaseClient MysqlClient = SqlDatabaseManager.GetClient()) { DataRow row = MysqlClient.ExecuteQueryRow("SELECT * FROM badge_definitions WHERE code = '" + Bits[2].Trim() + "'");; if (row == null) { MysqlClient.ExecuteScalar("INSERT INTO badge_definitions (code) VALUES('" + Bits[2].Trim() + "')"); row = MysqlClient.ExecuteQueryRow("SELECT * FROM badge_definitions WHERE code = '" + Bits[2].Trim() + "'"); } else { row = MysqlClient.ExecuteQueryRow("SELECT * FROM badge_definitions WHERE code = '" + Bits[2].Trim() + "'"); } MysqlClient.ExecuteScalar("INSERT INTO badges (user_id, badge_id, source_type) VALUES('" + CharacterResolverCache.GetUidFromName(Username) + "', '" + row["id"] + "', 'static')"); } TargetSession.SendData(RoomUserBadgesComposer.Compose(TargetSession.CharacterId, TargetSession.BadgeCache.EquippedBadges)); TargetSession.SendData(UserAlertModernComposer.Compose("Badges", "You just got a new badge, relog for showing off with it!")); return true; }
Fix for Givebadge command (U dont need to add badge_definitions now):
Code:case "givebadge": { if (!Session.HasRight("hotel_admin")) { return false; } string Username = UserInputFilter.FilterString(Bits[1].Trim()); Session TargetSession = SessionManager.GetSessionByCharacterId(CharacterResolverCache.GetUidFromName(Username)); if (TargetSession == null) { Session.SendData(UserAlertModernComposer.Compose("Badges", "You need to give a valid user.")); return false; } if (Bits[2].Trim() == "") { Session.SendData(UserAlertModernComposer.Compose("Badges", "You need to give a badge ID")); } using (SqlDatabaseClient MysqlClient = SqlDatabaseManager.GetClient()) { DataRow row = MysqlClient.ExecuteQueryRow("SELECT * FROM badge_definitions WHERE code = '" + Bits[2].Trim() + "'");; if (row == null) { MysqlClient.ExecuteScalar("INSERT INTO badge_definitions (code) VALUES('" + Bits[2].Trim() + "')"); row = MysqlClient.ExecuteQueryRow("SELECT * FROM badge_definitions WHERE code = '" + Bits[2].Trim() + "'"); } else { row = MysqlClient.ExecuteQueryRow("SELECT * FROM badge_definitions WHERE code = '" + Bits[2].Trim() + "'"); } MysqlClient.ExecuteScalar("INSERT INTO badges (user_id, badge_id, source_type) VALUES('" + CharacterResolverCache.GetUidFromName(Username) + "', '" + row["id"] + "', 'static')"); } TargetSession.SendData(RoomUserBadgesComposer.Compose(TargetSession.CharacterId, TargetSession.BadgeCache.EquippedBadges)); TargetSession.SendData(UserAlertModernComposer.Compose("Badges", "You just got a new badge, relog for showing off with it!")); return true; }
Snowlight is not even complete.
And you are making commands for it.
Why not completes it instead.
Thanks.
Nice release I guess :D Really coded by you? Because you said you're not really good at C#, yet, how did you code this? Possibly a Ctrl+C & Ctrl+V ?![]()
It's totally coded by me, and meth0d for Snowlight..
And no possibility of C&P because there are no other releases for givebadge/coins commands :)
And I'm coding for 2 years C++ and that because I said I'm not really good at it yet..
Lol'd show the GiveBadge, if it is released? or the coins? it needs to be totally different ;)
Snowlight is ****
Snowlight would of been the best EMU available IMO .. Roy is an amazing coder. Why do you think Phoenix is so popular....Only Aaron is even more lazy than Roy .. which sucks balls