Advertisement
Guest User

RGemas

a guest
Aug 20th, 2017
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.90 KB | None | 0 0
  1. # ▒██████ ▒██████████ #
  2. # ▒██ ▒██ ▒████ ▒███████ ▒████ ▒███████ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██████ ▒██ ▒██████ ▒████████ ▒████████ #
  3. # ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▀▀ #
  4. # ▒██ ▒██ ▒██ ▒██ ▒███████ ▒██ ▒██ ▒███████ ▒██ ▒██████████ ▒████ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒████████ #
  5. # ▒██████ ▒████████ ▒██ ▒████████ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██████ ▒██ ▒██████ ▒██ ▒██ #
  6. # ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ #
  7. # ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒███████ ▒███████ ▒██████████ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒██ ▒████████ #
  8.  
  9.  
  10.  
  11.  
  12.  
  13. on load:
  14. if file "plugins/Skript/scripts/RCash/data.yml" doesn't exists:
  15. create file "plugins/Skript/scripts/RCash/data.yml"
  16.  
  17. function AddCash(p: player, quantidade: integer):
  18. set {_cash} to value "%{_p}%.Cash" get of "plugins/Skript/scripts/RCash/data.yml"
  19. set {_cash} to {_cash} parsed as integer
  20. add {_quantidade} to {_cash}
  21. set "%{_p}%.Cash" to "%{_cash}%" in yaml file "plugins/Skript/scripts/RCash/data.yml"
  22.  
  23. function SetCash(p: player, quantidade: integer):
  24. set "%{_p}%.Cash" to "%{_quantidade}%" in yaml file "plugins/Skript/scripts/RCash/data.yml"
  25.  
  26. function RemoveCash(p: player, quantidade: integer):
  27. set {_cash} to value "%{_p}%.Cash" get of "plugins/Skript/scripts/RCash/data.yml"
  28. set {_cash} to {_cash} parsed as integer
  29. remove {_quantidade} from {_cash}
  30. set "%{_p}%.Cash" to "%{_cash}%" in yaml file "plugins/Skript/scripts/RCash/data.yml"
  31.  
  32. function pegarCash(p: player) :: integer:
  33. set {_cash} to value "%{_p}%.Cash" get of "plugins/Skript/scripts/RCash/data.yml"
  34. set {_cash} to {_cash} parsed as integer
  35. return {_cash}
  36.  
  37. function RandomKey(p: player, coins: integer) :: text:
  38. add "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y" and "Z" to {_keygen::*}
  39. add "1", "2", "3", "4", "5", "6", "7", "8", "9" and "0" to {_keygen::*}
  40. set {_s1} to "%random element out of {_keygen::*}%"
  41. set {_s2} to "%random element out of {_keygen::*}%"
  42. set {_s3} to "%random element out of {_keygen::*}%"
  43. set {_s4} to "%random element out of {_keygen::*}%"
  44. set {_s5} to "%random element out of {_keygen::*}%"
  45. set {_s6} to "%random element out of {_keygen::*}%"
  46. set {_s7} to "%random element out of {_keygen::*}%"
  47. set {_s8} to "%random element out of {_keygen::*}%"
  48. set {_s9} to "%random element out of {_keygen::*}%"
  49. set {_s10} to "%random element out of {_keygen::*}%"
  50. return "%{_s1}%%{_s2}%%{_s3}%%{_s4}%%{_s5}%%{_s6}%%{_s7}%%{_s8}%%{_s9}%%{_s10}%-%{_coins}%"
  51.  
  52. function OneMessage(p: player, msg: text):
  53. set {_espera} to difference between {delay.%{_p}%} and now
  54. if {_espera} is less than 1 seconds:
  55. stop
  56. else:
  57. send "%coloured {_msg}%" to {_p}
  58. set {delay.%{_p}%} to now
  59.  
  60. on join:
  61. #QUANDO ELE ENTRA SE O CASH N EXISTIR CRIA UM NOVO PLAYER
  62. set {_cash} to value "%player%.Cash" get of "plugins/Skript/scripts/RCash/data.yml"
  63. if {_cash} is not set:
  64. set "%player%.Cash" to "0" in yaml file "plugins/Skript/scripts/RCash/data.yml"
  65.  
  66. command /gemas [<player>]:
  67. trigger:
  68. if player has permission "cash.usar":
  69. if arg 1 is not set:
  70. set {_cash} to pegarCash(player)
  71. send "&7Voce possui &c%{_cash}% &7de gemas."
  72. if arg 1 is set:
  73. set {_cash} to pegarCash(arg-1)
  74. send "&7Esse jogador possui &c%{_cash}% &7de gemas."
  75. else:
  76. send "&4➤ &cInfelismente você não possui permissão para isso."
  77.  
  78.  
  79. command /adicionargemas [<player>] [<integer>]:
  80. trigger:
  81. if player has permission "cash.admin":
  82. if arg 1 is set:
  83. if arg 2 is set:
  84. AddCash(arg-1, arg-2)
  85. send "&4➤ &7Voce adicionou &c%arg 2% &7gemas na conta de &c%arg 1%&7."
  86. else:
  87. send "&4➤ &cUtilize /adicionargemas <jogador> <quantia>."
  88. else:
  89. send "&4➤ &cUtilize /adicionargemas <jogador> <quantia>."
  90. else:
  91. send "&4➤ &cInfelismente você não possui permissão para isso."
  92.  
  93. command /setargemas [<player>] [<integer>]:
  94. trigger:
  95. if player has permission "cash.admin":
  96. if arg 1 is set:
  97. if arg 2 is set:
  98. SetCash(arg-1, arg-2)
  99. send "&4➤ &7Voce setou a conta de &c%arg 1%&7 para &c%arg 2%&7."
  100. else:
  101. send "&4➤ &cUtilize /setargemas <jogador> <quantia>."
  102. else:
  103. send "&4➤ &cUtilize /setargemas <jogador> <quantia>."
  104. else:
  105. send "&4➤ &cInfelismente você não possui permissão para isso."
  106.  
  107. command /removergemas [<player>] [<integer>]:
  108. trigger:
  109. if player has permission "cash.admin":
  110. if arg 1 is set:
  111. if arg 2 is set:
  112. RemoveCash(arg-1, arg-2)
  113. send "&4➤ &7Voce removeu &c%arg 2% &7gemas da conta de &c%arg 1%&7."
  114. else:
  115. send "&4➤ &cUtilize /removergemas <jogador> <quantia>."
  116. else:
  117. send "&4➤ &cUtilize /removergemas <jogador> <quantia>."
  118. else:
  119. send "&4➤ &cInfelismente você não possui permissão para isso."
  120.  
  121. command /gerarkey [<integer>]:
  122. trigger:
  123. if player has permission "cash.admin":
  124. if arg 1 is set:
  125. set {_key} to RandomKey(player, arg-1)
  126. add "%{_key}%" to {keys::*}
  127. send "&4➤ &7Voce gerou a key: &c%{_key}%&7."
  128. else:
  129. send "&4➤ &cUtilize /gerarkey <quantia>."
  130. else:
  131. send "&4➤ &cInfelismente você não possui permissão para isso."
  132.  
  133. command /apagarkey [<text>]:
  134. trigger:
  135. if player has permission "cash.admin":
  136. if arg 1 is not set:
  137. send "&7&m---------------&c[Keys]&7&m---------------"
  138. if size of {keys::*} = 0:
  139. send "&7Nenhuma key foi encontrada."
  140. send "&cUtilize /apagarkey <key>."
  141. else:
  142. loop {keys::*}:
  143. send "&7%loop-index% &f-&c %loop-value%"
  144. send "&7&m-----------------------------------"
  145. send "&4➤ &cUtilize /apagarkey <quantia>."
  146. if arg 1 is set:
  147. send "&4➤ &7Voce apagou a key: &c%{keys::%arg 1%}%"
  148. delete {keys::%arg 1%}
  149. else:
  150. send "&4➤ &cInfelismente você não possui permissão para isso."
  151.  
  152. command /keylist:
  153. trigger:
  154. if player has permission "cash.admin":
  155. send "&7&m---------------&c[Keys]&7&m---------------"
  156. if size of {keys::*} = 0:
  157. send "&7Nenhuma key foi encontrada."
  158. send "&cUtilize /gerarkey <key>."
  159. else:
  160. loop {keys::*}:
  161. send "&7%loop-index% &f-&c %loop-value%"
  162. send "&7&m-----------------------------------"
  163. else:
  164. send "&4➤ &cInfelismente você não possui permissão para isso."
  165.  
  166. command /ativar [<text>]:
  167. trigger:
  168. if player has permission "cash.usar":
  169. if arg 1 is set:
  170. if size of {keys::*} = 0:
  171. send "&4➤ &cInfelismente essa key não existe."
  172. else:
  173. loop {keys::*}:
  174. if "%loop-value%" = "%arg-1%":
  175. set {_key} to "%arg-1%"
  176. remove {_key} from {keys::*}
  177. set {_word::*} to {_key} split at "-"
  178. set {_coins} to {_word::2}
  179. set {_coins} to {_coins} parsed as integer
  180. send "&c&lCASH &7Processando, aguarde..."
  181. wait 2 seconds
  182. send "&c&lCASH &7Processamento concluido, key valida , aguarde..."
  183. wait 1 seconds
  184. AddCash(player, {_coins})
  185. send "&c&lCASH &7Voce ativou &c%{_coins}% &7gemas. Parabens!"
  186. broadcast "&c&lCASH &7O &c%player% &7ativou &c%{_coins}% &7gemas."
  187. stop loop
  188. else:
  189. OneMessage(player, "&4➤ Infelismente ocorreu um erro com essa key, aguarde...")
  190. else:
  191. send "&4➤ &cUtilize /ativar <key>."
  192. else:
  193. send "&4➤ &cInfelismente você não possui permissão para isso."
  194.  
  195. #---------API---------
  196. #AddCash(player, <numero>) exemplo: AddCash(player, 100)
  197. #Tambem pode ser usado em qualquer lugar que tenha player exemplo
  198. #AddCash(victim, 100)
  199.  
  200. #SetCash(player, 1000) #SET CASH PARA O PLAYER
  201.  
  202. #RemoveCash(player, 900) REMOVE CASH DO PLAYER
  203.  
  204. #set {_playercash} to pegarCash(player)
  205. #{_playercash} RETORNA A QUANTIDADE DE CASH DO PLAYER
  206. #EXEMPLO:
  207. #if {_playercash} >= 1000:
  208. # send "Voce comprou um kit por 1000 de Cash"
  209. # RemoveCash(player, 1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement