Seuss_CZ

Untitled

Jan 16th, 2017
86
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using fr34kyn01535.Uconomy;
  5. using Rocket.Core.Logging;
  6. using SDG.Unturned;
  7.  
  8. using Rocket.API;
  9. using Rocket.Unturned.Chat;
  10. using UnityEngine;
  11. using Rocket.Unturned.Player;
  12.  
  13. namespace ZaupFeast
  14. {
  15. public class CommandSelfFeast : IRocketCommand
  16. {
  17. public string Name
  18. {
  19. get { return "selffeast"; }
  20. }
  21. public string Help
  22. {
  23. get { return "Starts the feast onto the player"; }
  24. }
  25. public string Syntax
  26. {
  27. get { return ""; }
  28. }
  29. public List<string> Aliases
  30. {
  31. get { return new List<string> { "sfeast" }; }
  32. }
  33. public List<string> Permissions
  34. {
  35. get { return new List<string>(); }
  36. }
  37.  
  38. public AllowedCaller AllowedCaller
  39. {
  40. get
  41. {
  42. return AllowedCaller.Both;
  43. }
  44. }
  45.  
  46. // Run the command.
  47. public void Execute(IRocketPlayer caller, string[] command)
  48. {
  49. decimal balance = Uconomy.Instance.Database.GetBalance(Player.id);
  50. if (balance < 100)
  51. {
  52. UnturnedChat.Say(caller, Feast.Instance.Translate("car_not_enough_currency", Uconomy.Instance.Configuration.Instance.MoneyName));
  53. return;
  54. }
  55. Rocket.Core.Logging.Logger.Log("L'utilisateur possede assez d'argent");
  56. /* -- PAIEMENT -- */
  57. decimal bal = Uconomy.Instance.Database.IncreaseBalance(Player.Id, (100 * -1));
  58. if (bal >= 0.0m)
  59. UnturnedChat.Say(caller, Feast.Instance.Translate("new_balance_msg", new object[] { bal, Uconomy.Instance.Configuration.Instance.MoneyName }));
  60.  
  61.  
  62. Locs loc = new Locs(((UnturnedPlayer)caller).Position, ((UnturnedPlayer)caller).DisplayName + "'s pos");
  63. Feast.Instance.nextLocation = loc;
  64. UnturnedChat.Say(Feast.Instance.Translate("now_feast_msg", new object[] {
  65. Feast.Instance.nextLocation.Name
  66. }), UnturnedChat.GetColorFromName(Feast.Instance.Configuration.Instance.MessageColor, Color.red));
  67. Feast.Instance.runFeast();
  68. }
  69. }
  70. }
RAW Paste Data