Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region
- using Plus.Communication.Packets.Outgoing.Inventory.Purse;
- using Plus.HabboHotel.GameClients;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- #endregion
- namespace Plus.HabboHotel.Rooms.Chat.Commands.User.Fun
- {
- internal class PayCommand : IChatCommand
- {
- public string PermissionRequired => "command_pay";
- public string Parameters => "%username% & %type% & %id%";
- public string Description => "Enviar a um amigo créditos ou diamantes.";
- public void Execute(GameClient Session, Room Room, string[] Params)
- {
- if (Params.Length == 1)
- {
- Session.SendWhisper("Oops, você deve digitar o nick do usuário!");
- return;
- }
- if (Params.Length == 2)
- {
- Session.SendWhisper("Oops, você esqueceu-se de especificar qual é a moeda. (credits/diamonds)");
- return;
- }
- if (Params.Length == 3)
- {
- Session.SendWhisper("Oops, você esqueceu-se de especificar a quantidade que deseja enviar.");
- return;
- }
- else if (Params[3].Contains("-"))
- {
- Session.SendWhisper("Oops, você não pode colocar isso! (E:3)");
- return;
- }
- GameClient TargetClient = null;
- TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
- if (TargetClient == null)
- {
- Session.SendWhisper("Oops, o usuário não encontra-se online!");
- return;
- }
- if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
- {
- Session.SendWhisper("Oops, você não pode executar esse comando em si mesmo!");
- return;
- }
- int Amount = Convert.ToInt32(Params[3]);
- var Options = Params[2];
- switch (Options.ToLower())
- {
- case "credits":
- case "moedas":
- {
- if (Session.GetHabbo().Credits < Amount)
- {
- Session.SendWhisper("Oops, você não tem créditos suficientes! (E:1)");
- return;
- }
- if (Amount > Session.GetHabbo().Credits)
- {
- Session.SendWhisper("Oops, você não tem créditos suficientes! (E:2)");
- return;
- }
- Session.GetHabbo().Credits -= Amount;
- Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
- TargetClient.GetHabbo().Credits += Amount;
- TargetClient.SendMessage(new CreditBalanceComposer(TargetClient.GetHabbo().Credits));
- Session.SendWhisper("Enviou com sucesso " + Amount + " créditos de sua conta para a conta de " + TargetClient.GetHabbo().Username + " !");
- TargetClient.SendWhisper("Recebeu com sucesso do usuário " + Session.GetHabbo().Username + " " + Amount + " créditos!");
- break;
- }
- case "diamonds":
- case "diamantes":
- {
- if (Session.GetHabbo().Diamonds < Amount)
- {
- Session.SendWhisper("Oops, você não tem diamantes suficientes! (E:1)");
- return;
- }
- if (Amount > Session.GetHabbo().Diamonds)
- {
- Session.SendWhisper("Oops, você não tem diamantes suficientes! (E:2)");
- return;
- }
- Session.GetHabbo().Diamonds -= Amount;
- Session.SendMessage(new HabboActivityPointNotificationComposer(Session.GetHabbo().Diamonds, -Amount, 5));
- TargetClient.GetHabbo().Diamonds += Amount;
- TargetClient.SendMessage(new HabboActivityPointNotificationComposer(TargetClient.GetHabbo().Diamonds, Amount, 5));
- Session.SendWhisper("Enviou com sucesso " + Amount + " diamantes de sua conta para a conta de " + TargetClient.GetHabbo().Username + " !");
- TargetClient.SendWhisper("Recebeu com sucesso do usuário " + Session.GetHabbo().Username + " " + Amount + " diamantes!");
- break;
- }
- default:
- {
- Session.SendWhisper("Oops, essa opção não existe! Apenas existe as opções: (credits/diamonds)");
- break;
- }
- }
- }
- }
- }
- CRÉDITOS:
- SNAIKER (POLLAK)
- ARQUIVOSHPS
Advertisement
Add Comment
Please, Sign In to add comment