Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Text;
- using System.Collections.Generic;
- using Plus.HabboHotel.GameClients;
- using Plus.Communication.Packets.Outgoing.Inventory.Purse;
- namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator
- {
- class GiveCommand : IChatCommand
- {
- public string PermissionRequired
- {
- get { return "command_give"; }
- }
- public string Parameters
- {
- get { return "%username% %type% %amount%\n--------------------------------------------------------------"; }
- }
- public string Description
- {
- get { return ""; }
- }
- public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
- {
- if (Params.Length == 1)
- {
- Session.SendWhisper("Entrer un type de monnaie! (coins, duckets, diamonds, gotw)");
- return;
- }
- GameClient Target = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
- if (Target == null)
- {
- Session.SendWhisper("Désolé, cet utilisateur n'existe pas");
- return;
- }
- string UpdateVal = Params[2];
- switch (UpdateVal.ToLower())
- {
- case "coins":
- case "credits":
- {
- if (!Session.GetHabbo().GetPermissions().HasCommand("command_give_coins"))
- {
- Session.SendWhisper("Mince! tu n'as pas les droits pour utilisé cette commande!");
- break;
- }
- else
- {
- int Amount;
- if (int.TryParse(Params[3], out Amount))
- {
- Target.GetHabbo().Credits = Target.GetHabbo().Credits += Amount;
- Target.SendMessage(new CreditBalanceComposer(Target.GetHabbo().Credits));
- if (Target.GetHabbo().Id != Session.GetHabbo().Id)
- Target.SendNotification(Session.GetHabbo().Username + " t'as donner " + Amount.ToString() + " crédit(s)!");
- Session.SendWhisper("Tu viens de donner " + Amount + " crédit(s) à " + Target.GetHabbo().Username + "!");
- break;
- }
- else
- {
- Session.SendWhisper("Mince! le montant est invalide!");
- break;
- }
- }
- }
- case "pixels":
- case "duckets":
- {
- if (!Session.GetHabbo().GetPermissions().HasCommand("command_give_pixels"))
- {
- Session.SendWhisper("Mince! tu n'as pas les droits pour utilisé cette commande!");
- break;
- }
- else
- {
- int Amount;
- if (int.TryParse(Params[3], out Amount))
- {
- Target.GetHabbo().Duckets += Amount;
- Target.SendMessage(new HabboActivityPointNotificationComposer(Target.GetHabbo().Duckets, Amount));
- if (Target.GetHabbo().Id != Session.GetHabbo().Id)
- Target.SendNotification(Session.GetHabbo().Username + " t'as donner " + Amount.ToString() + " ducket(s)!");
- Session.SendWhisper("Tu viens de donner " + Amount + " ducket(s) à " + Target.GetHabbo().Username + "!");
- break;
- }
- else
- {
- Session.SendWhisper("Mince! le montant est invalide!");
- break;
- }
- }
- }
- case "diamonds":
- {
- if (!Session.GetHabbo().GetPermissions().HasCommand("command_give_diamonds"))
- {
- Session.SendWhisper("Mince! tu n'as pas les droits pour utilisé cette commande!");
- break;
- }
- else
- {
- int Amount;
- if (int.TryParse(Params[3], out Amount))
- {
- Target.GetHabbo().Diamonds += Amount;
- Target.SendMessage(new HabboActivityPointNotificationComposer(Target.GetHabbo().Diamonds, Amount, 5));
- if (Target.GetHabbo().Id != Session.GetHabbo().Id)
- Target.SendNotification(Session.GetHabbo().Username + " t'as donner " + Amount.ToString() + " diamants!");
- Session.SendWhisper("Tu viens de donner " + Amount + " diamants à " + Target.GetHabbo().Username + "!");
- break;
- }
- else
- {
- Session.SendWhisper("Mince, le montant est invalide!");
- break;
- }
- }
- }
- case "gotw":
- case "gotwpoints":
- {
- if (!Session.GetHabbo().GetPermissions().HasCommand("command_give_gotw"))
- {
- Session.SendWhisper("Mince! tu n'as pas les droits pour utilisé cette commande!");
- break;
- }
- else
- {
- int Amount;
- if (int.TryParse(Params[3], out Amount))
- {
- Target.GetHabbo().GOTWPoints = Target.GetHabbo().GOTWPoints + Amount;
- Target.SendMessage(new HabboActivityPointNotificationComposer(Target.GetHabbo().GOTWPoints, Amount, 103));
- if (Target.GetHabbo().Id != Session.GetHabbo().Id)
- Target.SendNotification(Session.GetHabbo().Username + " t'as donner " + Amount.ToString() + " GOTW Point(s)!");
- Session.SendWhisper("Tu viens de donner " + Amount + " GOTW point(s) à " + Target.GetHabbo().Username + "!");
- break;
- }
- else
- {
- Session.SendWhisper("Mince, le montant est invalide!");
- break;
- }
- }
- }
- default:
- Session.SendWhisper("'" + UpdateVal + "' n'est pas valide!");
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement