Seuss_CZ

Untitled

Jan 17th, 2017
105
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.  
  5. using Rocket.API;
  6. using Rocket.Unturned.Chat;
  7. using UnityEngine;
  8. using Rocket.Unturned.Player;
  9. using fr34kyn01535.Uconomy;
  10.  
  11. namespace ZaupFeast
  12. {
  13. public class CommandSelfFeast : IRocketCommand
  14. {
  15. public string Name
  16. {
  17. get { return "box"; }
  18. }
  19. public string Help
  20. {
  21. get { return "Starts the feast onto the player"; }
  22. }
  23. public string Syntax
  24. {
  25. get { return ""; }
  26. }
  27. public List<string> Aliases
  28. {
  29. get { return new List<string> { "box" }; }
  30. }
  31. public List<string> Permissions
  32. {
  33. get { return new List<string>(); }
  34. }
  35.  
  36. public AllowedCaller AllowedCaller
  37. {
  38. get
  39. {
  40. return AllowedCaller.Both;
  41. }
  42. }
  43.  
  44. // Run the command.
  45. public void Execute(IRocketPlayer caller, string[] command)
  46. {
  47. UnturnedPlayer player = (UnturnedPlayer)caller;
  48. if (command.Length == 0)
  49. {
  50. UnturnedChat.Say(player, Feast.Instance.Translate("command_usage"));
  51. return;
  52. }
  53. decimal balance = Uconomy.Instance.Database.GetBalance(caller.Id);
  54. if (command.Length == 1)
  55. {
  56. switch (command[0])
  57. {
  58. case ("crate"):
  59. /** UCONOMY **/
  60. if (balance < 100)
  61. {
  62. UnturnedChat.Say(caller, "You are too poor");
  63. }
  64. else
  65. {
  66. decimal bal = Uconomy.Instance.Database.IncreaseBalance(caller.Id, (100 * -1));
  67. /** FEAST **/
  68. Locs loc = new Locs(((UnturnedPlayer)caller).Position, ((UnturnedPlayer)caller).DisplayName + "'s pos");
  69. Feast.Instance.nextLocation = loc;
  70. UnturnedChat.Say(caller, Feast.Instance.Translate("box_info"), Color.cyan);
  71. UnturnedChat.Say(caller, Feast.Instance.Translate("now_feast_msg", new object[] {
  72. Feast.Instance.nextLocation.Name
  73. }), UnturnedChat.GetColorFromName(Feast.Instance.Configuration.Instance.MessageColor, Color.yellow));
  74. Feast.Instance.runFeast();
  75. }
  76. break;
  77.  
  78. case ("crate2"):
  79. /** UCONOMY **/
  80. if (balance < 50)
  81. {
  82. UnturnedChat.Say(caller, "You are too poor");
  83. }
  84. else
  85. {
  86. decimal bal = Uconomy.Instance.Database.IncreaseBalance(caller.Id, (50 * -1));
  87. /** FEAST **/
  88. Locs loc = new Locs(((UnturnedPlayer)caller).Position, ((UnturnedPlayer)caller).DisplayName + "'s pos");
  89. Feast.Instance.nextLocation = loc;
  90. UnturnedChat.Say(caller, Feast.Instance.Translate("box_info"), UnturnedChat.GetColorFromName(Feast.Instance.Configuration.Instance.MessageColor, Color.yellow));
  91. UnturnedChat.Say(caller, Feast.Instance.Translate("now_feast_msg", new object[] {
  92. Feast.Instance.nextLocation.Name
  93. }), UnturnedChat.GetColorFromName(Feast.Instance.Configuration.Instance.MessageColor, Color.green));
  94. Feast.Instance.runFeast2();
  95. }
  96. break;
  97. }
  98. }
  99. }
  100. }
  101. }
RAW Paste Data