Onenrico

Virtual bank

Mar 1st, 2016
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.97 KB | None | 0 0
  1. # Changelog V1.0.1 By Enrico
  2. #
  3. # Bug Pencurian Kepala saat /vb stats - Fixed
  4. # Ceks Feature Added
  5. # Variable Optimize
  6. #
  7. #
  8.  
  9. options:
  10.  
  11. Prefix: &7[&6V-Bank&7]
  12. Logo: &6&lVirtual Bank
  13.  
  14. # --- About --- #
  15. Author: &dYusrilTakeuchi
  16. Version: &dV1.0.1
  17.  
  18. # --- Max Saldo Nasabah --- #
  19. MaxSaldo: 1000000
  20.  
  21. # --- Permission --- #
  22. PermAdm: virtualbank.admin
  23.  
  24.  
  25. # --- Variable Page --- #
  26. variables:
  27. {vbsaldo::%player%} = 0
  28.  
  29. # --- Command Page --- #
  30. command /virtualbank [<text>] [<integer>] [<offlineplayer>]:
  31. aliases: /vb
  32. trigger:
  33.  
  34. if arg 1 is not set:
  35. message "&a//&a&m----------&7[ {@Logo} &7]&a&m----------&a\\"
  36. message "&a/vb withdraw <value> &7- &eMengambil uang dalam bank"
  37. message "&a/vb deposit <value> &7- &eMenabung uang kedalam bank"
  38. message "&a/vb transfer <value> <player> &7- &eMengirim uang ke player"
  39. message "&a/vb stats &7- &eMelihat jumlah saldo uang"
  40. message "&a/vb top &7- &eMelihat top nasabah"
  41. message "&a/vb ceks <value> &7- &eMembuat sebuah ceks"
  42. player has permission "{@PermAdm}":
  43. message "&a/vb give <value> <player> &7- &eMengirim saldo pada player"
  44. message " "
  45. message "&6Author&7: {@Author}"
  46. message "&6Version&7: {@Version}"
  47. if arg 1 is "help":
  48. message "&a//&a&m----------&7[ {@Logo} &7]&a&m----------&a\\"
  49. message "&a/vb withdraw <value> &7- &eMengambil uang dalam bank"
  50. message "&a/vb deposit <value> &7- &eMenabung uang kedalam bank"
  51. message "&a/vb transfer <value> <player> &7- &eMengirim uang ke player"
  52. message "&a/vb stats &7- &eMelihat jumlah saldo uang"
  53. message "&a/vb top &7- &eMelihat top nasabah"
  54. message "&a/vb ceks <value> &7- &eMembuat sebuah ceks"
  55. player has permission "{@PermAdm}":
  56. message "&a/vb give <value> <player> &7- &eMengirim saldo pada player"
  57. message " "
  58. message "&6Author&7: {@Author}"
  59. message "&6Version&7: {@Version}"
  60.  
  61.  
  62. # --- Withdraw Page --- #
  63. if arg 1 is "withdraw":
  64. if arg 2 is set:
  65. if {vbsaldo::%player%} is greater than 0:
  66. if arg-2 is less than or equal to {vbsaldo::%player%}:
  67. remove arg-2 from {vbsaldo::%player%}
  68. add arg-2 to player's account
  69.  
  70. message "{@Prefix} &bBerhasil mengambil uang sebanyak &a$%arg 2%!"
  71. stop
  72. else:
  73. message "{@Prefix} &cJumlah saldo tidak cukup!"
  74. stop
  75. else:
  76. message "{@Prefix} &cJumlah saldo tidak cukup!"
  77. stop
  78. else:
  79. message "{@Prefix} &cMasukkan jumlah saldo!"
  80. stop
  81.  
  82.  
  83. # --- Deposit Page --- #
  84. if arg 1 is "deposit":
  85. if arg 2 is set:
  86. if {vbsaldo::%player%} is less than or equal to {@MaxSaldo}:
  87. if player's balance is greater than or equal to arg-2:
  88. add arg-2 to {vbsaldo::%player%}
  89. remove arg-2 from player's account
  90. message "{@Prefix} &bBerhasil menabung uang sebanyak &a$%arg 2%!"
  91. stop
  92. message "{@Prefix} &cJumlah uang tidak cukup untuk mengisi saldo!"
  93. else:
  94. message "{@Prefix} &cJumlah saldo telah mencapai maksimum!"
  95. stop
  96. else:
  97. message "{@Prefix} &cMasukkan jumlah saldo!"
  98. stop
  99.  
  100.  
  101. # --- Transfer Page --- #
  102. if arg 1 is "transfer":
  103. if arg 2 is set:
  104. if arg 3 is online:
  105. if arg-2 is less than or equal to {vbsaldo::%player%}:
  106. add arg-2 to {vbsaldo::%arg 3%}
  107. remove arg-2 from {vbsaldo::%player%}
  108. message "{@Prefix} &bBerhasil transfer saldo sebanyak &a$%arg 2%!"
  109. message "{@Prefix} &bKamu telah mendapatkan saldo sebesar &a$%arg 2% &bdari %player%" to arg-3
  110. stop
  111. else:
  112. message "{@Prefix} &cJumlah saldo tidak cukup!"
  113. stop
  114. else:
  115. message "{@Prefix} &cPlayer tidak online!"
  116. stop
  117. else:
  118. message "{@Prefix} &cMasukkan jumlah saldo!"
  119.  
  120. if arg 1 is "give":
  121. if arg 2 is set:
  122. if arg 3 is online:
  123. player has permission "{@PermAdm}":
  124. add arg-2 to {vbsaldo::%arg 3%}
  125.  
  126. message "{@Prefix} &bBerhasil transfer saldo sebanyak &a$%arg 2%!"
  127. message "{@Prefix} &bKamu telah mendapatkan saldo sebesar &a$%arg 2% &bdari %player%" to arg-3
  128. stop
  129. else:
  130. message "{@Prefix} &cKamu tidak punya izin!"
  131. stop
  132. else:
  133. message "{@Prefix} &cPlayer tidak online!"
  134. stop
  135. else:
  136. message "{@Prefix} &cMasukkan jumlah saldo!"
  137.  
  138. if arg 1 is "top":
  139. set {_Topstats::*} to sorted {vbsaldo::*} from highest to lowest with output "&d@index &aSaldo&7: &c@value"
  140. message "&a//&a&m----------&7[ &a&lTop Nasabah &7]&a&m----------&a\\"
  141. if {_Topstats::1} is set:
  142. send "&a1. %{_Topstats::1}%"
  143. if {_Topstats::2} is set:
  144. send "&a2. %{_Topstats::2}%"
  145. if {_Topstats::3} is set:
  146. send "&a3. %{_Topstats::3}%"
  147. if {_Topstats::4} is set:
  148. send "&a4. %{_Topstats::4}%"
  149. if {_Topstats::5} is set:
  150. send "&a5. %{_Topstats::5}%"
  151. if {_Topstats::6} is set:
  152. send "&a6. %{_Topstats::6}%"
  153. if {_Topstats::7} is set:
  154. send "&a7. %{_Topstats::7}%"
  155. if {_Topstats::8} is set:
  156. send "&a8. %{_Topstats::8}%"
  157. if {_Topstats::9} is set:
  158. send "&a9. %{_Topstats::9}%"
  159. if {_Topstats::10} is set:
  160. send "&a10. %{_Topstats::10}%"
  161.  
  162.  
  163. if arg 1 is "stats":
  164. wait 5 tick
  165. open chest with 1 rows named "&6-Bank Stats-" to player
  166. format slot 0 of player with player's skull named "&a&m----------&7[ Status Nasabah &7]&a&m----------" with lore " ||&3Name&7: &6%player%||&3Saldo&7: &a$%{vbsaldo::%player%}%" to close then run "sudo %player% vb stats"
  167.  
  168. if arg 1 is "Ceks":
  169. set {_nominal} to arg 2
  170. set {_rumus} to arg 2 + (arg 2 * 0.1)
  171. if player's balance is more than {_rumus}:
  172. give paper named "&f&lCEK &bBank&r &7[&6%{_nominal}%&7]" with lore "&6> &fCek Balance||&6> &fNominal: %{_nominal}%||&6> &fCommand /cairkan||&6> &fUntuk Menambahkan ke akun Bankmu||" to player
  173. subtract {_rumus} from player's balance
  174. send "&7[&fCeks&7]&fKamu Menulis Ceks Dengan Nominal %arg 2%"
  175. send "&7[&fCeks&7]&fUangmu Berkurang %{_rumus}% sebagai Biaya"
  176. if player's balance is equal to {_rumus}:
  177. send "&7[&fCeks&7]&fSetidaknya uangmu harus tersisa 1"
  178. if player's balance is less than {_rumus}:
  179. send "&7[&fCeks&7]&fUangmu tidak cukup"
  180. send "&7[&fCeks&7]&fKamu Membutuhkan %{_rumus}%"
  181. send "&7[&fCeks&7]&fSedangkan uangmu hanya %player's balance%"
  182. command /cairkan:
  183. trigger:
  184. if player tool is paper:
  185. if name of player's tool contains "BALANCE":
  186. if lore of player's tool is set:
  187. set {_lore::*} to lore of player's tool split at "||"
  188. set {_nominal} to uncolored {_lore::2}
  189. replace all "> Nominal: " with "" in {_nominal}
  190. set {_akhir} to {_nominal} parsed as number
  191. remove 1 of tool from tool
  192. wait 1 tick
  193. add {_akhir} to player's balance
  194. send "&7[&fCeks&7]&fSaldo Bank mu bertambah &l%{_akhir}%"
  195. send "&7[&fCeks&7]&fSaldo Bank mu menjadi &l%{vbsaldo::%player%}%"
  196. stop
  197. on inventory close:
  198. loop items in player's inventory:
  199. if name of loop-item is "&a&m----------&7[ Status Nasabah &7]&a&m----------":
  200. remove loop-item from player
Add Comment
Please, Sign In to add comment