Normal Plus EMU (not new UI) Need Crystal / Belcredits command

Results 1 to 6 of 6
  1. #1
    iiiiiiiiiii Brought is offline
    MemberRank
    Aug 2013 Join Date
    469Posts

    Normal Plus EMU (not new UI) Need Crystal / Belcredits command

    Hello. I was wondering if anyone was able to code me or give me the code from their emulator for Crystals?

    Please let me know..
    Thanks!


  2. #2
    Account Upgraded | Title Enabled! YoWesty is offline
    MemberRank
    Oct 2012 Join Date
    285Posts

    Re: Normal Plus EMU (not new UI) Need Crystal / Belcredits command

    Quote Originally Posted by Brought View Post
    Hello. I was wondering if anyone was able to code me or give me the code from their emulator for Crystals?

    Please let me know..
    Thanks!
    The one for the New UI should work fine.

  3. #3
    Account Upgraded | Title Enabled! Fishing Rod is offline
    MemberRank
    Dec 2013 Join Date
    214Posts

    Re: Normal Plus EMU (not new UI) Need Crystal / Belcredits command

    Use this :

    Add this code to your ChatCommandHandler.cs

    Code:
                                        #region Give Crystals (:belcredits)
                    case "crystals":
                    case "givecrystals":
                        {
                            if (Session.GetHabbo().HasCmd("crystals"))
                            {
    
    
                                GameClient TargetClient = null;
                                Room TargetRoom = Session.GetHabbo().CurrentRoom;
    
    
                                TargetClient = SilverwaveEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
                                if (TargetClient != null)
                                {
                                    int creditsToAdd;
                                    if (int.TryParse(Params[2], out creditsToAdd))
                                    {
                                        TargetClient.GetHabbo().BelCredits = TargetClient.GetHabbo().BelCredits + creditsToAdd;
                                        Session.GetHabbo().NotifyNewCrystals(creditsToAdd);
                                        TargetClient.GetHabbo().UpdateActivityPointsBalance();
                                        TargetClient.SendNotif(Session.GetHabbo().Username + (" has awarded you ") + creditsToAdd.ToString() + (" Crystals!"));
                                        Session.SendNotif(("Crystals balance updated successfully."));
                                        return true;
                                    }
                                    else
                                    {
    Then on Habbo.cs Find :

    Code:
    HabboinfoSaved = true;
    Replace the line under it

    Code:
                    return "UPDATE users SET online='0', last_online = '" + SilverwaveEnvironment.GetUnixTimestamp() + "', activity_points = '" + ActivityPoints + "', credits = '" + Credits + "', belcredits = '" + BelCredits + "' WHERE id = '" + Id + "'; UPDATE user_stats SET AchievementScore = " + AchievementPoints + " WHERE id=" + Id + " LIMIT 1; ";
                }
    In your Habbo.cs Find
    Code:
    internal void NotifyNewPixels(int Change)
    Add below :

    Code:
            internal void NotifyNewCrystals(int Change)
            {
                if (mClient == null || mClient.GetMessageHandler() == null || mClient.GetMessageHandler().GetResponse() == null)
                    return;
                mClient.GetMessageHandler().GetResponse().Init(Outgoing.AlertDucketAmount);
                mClient.GetMessageHandler().GetResponse().AppendInt32(BelCredits); //amount
                mClient.GetMessageHandler().GetResponse().AppendInt32(Change); //change
                mClient.GetMessageHandler().GetResponse().AppendInt32(0); //type
                mClient.GetMessageHandler().SendResponse();
            }
    Run this SQL :

    Code:
    INSERT INTO `fuse_cmds` (`id`, `command`, `rank`, `params`, `description`) VALUES
    (86, 'crystals', 8, '%user% %amount', 'Give diamonds to a user');

  4. #4
    Member nixia12 is offline
    MemberRank
    Mar 2014 Join Date
    50Posts

    Re: Normal Plus EMU (not new UI) Need Crystal / Belcredits command

    Quote Originally Posted by Fishing Rod View Post
    Use this :

    Add this code to your ChatCommandHandler.cs

    Code:
                                        #region Give Crystals (:belcredits)
                    case "crystals":
                    case "givecrystals":
                        {
                            if (Session.GetHabbo().HasCmd("crystals"))
                            {
    
    
                                GameClient TargetClient = null;
                                Room TargetRoom = Session.GetHabbo().CurrentRoom;
    
    
                                TargetClient = SilverwaveEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
                                if (TargetClient != null)
                                {
                                    int creditsToAdd;
                                    if (int.TryParse(Params[2], out creditsToAdd))
                                    {
                                        TargetClient.GetHabbo().BelCredits = TargetClient.GetHabbo().BelCredits + creditsToAdd;
                                        Session.GetHabbo().NotifyNewCrystals(creditsToAdd);
                                        TargetClient.GetHabbo().UpdateActivityPointsBalance();
                                        TargetClient.SendNotif(Session.GetHabbo().Username + (" has awarded you ") + creditsToAdd.ToString() + (" Crystals!"));
                                        Session.SendNotif(("Crystals balance updated successfully."));
                                        return true;
                                    }
                                    else
                                    {
    Then on Habbo.cs Find :

    Code:
    HabboinfoSaved = true;
    Replace the line under it

    Code:
                    return "UPDATE users SET online='0', last_online = '" + SilverwaveEnvironment.GetUnixTimestamp() + "', activity_points = '" + ActivityPoints + "', credits = '" + Credits + "', belcredits = '" + BelCredits + "' WHERE id = '" + Id + "'; UPDATE user_stats SET AchievementScore = " + AchievementPoints + " WHERE id=" + Id + " LIMIT 1; ";
                }
    In your Habbo.cs Find
    Code:
    internal void NotifyNewPixels(int Change)
    Add below :

    Code:
            internal void NotifyNewCrystals(int Change)
            {
                if (mClient == null || mClient.GetMessageHandler() == null || mClient.GetMessageHandler().GetResponse() == null)
                    return;
                mClient.GetMessageHandler().GetResponse().Init(Outgoing.AlertDucketAmount);
                mClient.GetMessageHandler().GetResponse().AppendInt32(BelCredits); //amount
                mClient.GetMessageHandler().GetResponse().AppendInt32(Change); //change
                mClient.GetMessageHandler().GetResponse().AppendInt32(0); //type
                mClient.GetMessageHandler().SendResponse();
            }
    Run this SQL :

    Code:
    INSERT INTO `fuse_cmds` (`id`, `command`, `rank`, `params`, `description`) VALUES
    (86, 'crystals', 8, '%user% %amount', 'Give diamonds to a user');
    wow..nice share this code, rod. thanks so much.

  5. #5
    Account Upgraded | Title Enabled! Fishing Rod is offline
    MemberRank
    Dec 2013 Join Date
    214Posts

    Re: Normal Plus EMU (not new UI) Need Crystal / Belcredits command

    Quote Originally Posted by nixia12 View Post
    wow..nice share this code, rod. thanks so much.
    NP bro =)

  6. #6
    iiiiiiiiiii Brought is offline
    MemberRank
    Aug 2013 Join Date
    469Posts

    Re: Normal Plus EMU (not new UI) Need Crystal / Belcredits command

    Thanks for this but I already solved this. Seeing as how this thread was posted 3 weeks ago lmfao.



Advertisement