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');