Guest User

Untitled

a guest
Feb 9th, 2018
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.58 KB | None | 0 0
  1. options:
  2. cmd_point: /point
  3.  
  4. start: 0
  5.  
  6. page_size: 8
  7. first join:
  8. if {point::%uuid of player%} is not set:
  9. execute console command "{@cmd_point} create %player%"
  10. else:
  11. if "%{point::%uuid of player%}%" is not "%player%":
  12. set {point::%uuid of player%} to "%player%"
  13. send "§bTransfert de votre ancien compte bancaire." to player
  14. join:
  15. if {point::%uuid of player%} is not set:
  16. execute console command "{@cmd_point} create %player%"
  17. else:
  18. if "%{point::%uuid of player%}%" is not "%player%":
  19. set {point::%uuid of player%} to "%player%"
  20. send "§bTransfert de votre ancien compte bancaire." to player
  21. command {@cmd_point} [<text>] [<text>] [<text>]:
  22. trigger:
  23. if argument 1 is "help" or "h" or "?":
  24. if argument 2 parsed as number is set:
  25. add "§b{@cmd_point} h,help,?§3 [page=1]§f affiche l'aide" to {_commands::*}
  26. add "§b{@cmd_point} create§3 <uuid>§f créer un compte." to {_commands::*}
  27. add "§b{@cmd_point} del,delete§3 <uuid>§f supprimer un compte." to {_commands::*}
  28. add "§b{@cmd_point} give/take/set§3 <uuid> <amount>§f faire varier le montant d'un compte." to {_commands::*}
  29. add "§b{@cmd_point}§3 <uuid=you>§f voir l'argent d'un joueur." to {_commands::*}
  30. add "§b{@cmd_point} top§3 [page=1]§f voir le classement." to {_commands::*}
  31. if argument 2 parsed as number is bigger than 0:
  32. if argument 2 parsed as number is smaller or equal to rounded up (size of {_commands::*} / {@page_size}):
  33. send "§8§m-------------------------%nl%§8Page %argument 2 parsed as number%/%rounded up (size of {_commands::*} / {@page_size})%" to sender
  34. loop {_commands::*}:
  35. send "%loop-value%" to sender
  36. send "§8§m-------------------------" to sender
  37. else:
  38. send "§cErreur: La page demandée n'a pas pu être affichée." to sender
  39. else:
  40. send "§cErreur: La page demandée n'a pas pu être affichée." to sender
  41. else:
  42. execute sender command "{@cmd_point} ? 1"
  43. else if argument 1 is "create":
  44. if argument 2 parsed as player is set:
  45. execute sender command "{@cmd_point} create %uuid of argument 2 parsed as player%"
  46. else if argument 2 is set:
  47. loop all players:
  48. if "%uuid of loop-player%" is "%argument 2%":
  49. set {_found} to "%loop-player%"
  50. exit loop
  51. if {_found} is set:
  52. if {point::%argument 2%} is not set:
  53. set {point::%argument 2%} to "%{_found}%"
  54. if {point::%argument 2%::value} is not set:
  55. set {point::%argument 2%::value} to {@start}
  56. send "§bCréation du compte:§3 %{_found}% --> {@start}$%nl%§bChemin d'accès:§f %argument 2%" to sender and "%{_found}%" parsed as player
  57. else:
  58. send "§cErreur: Ce compte existe déjà." to sender
  59. else:
  60. send "§cErreur: Aucun joueur connecté n'est associé à cet UUID." to sender
  61. else:
  62. send "§cErreur: {@cmd_point} h,help,? [page=1] pour afficher l'aide." to sender
  63. else if argument 1 is "del" or "delete":
  64. if argument 2 is set:
  65. if "%argument 2%" parsed as offline player is online:
  66. if {point::%uuid of argument 2 parsed as offline player%} is set:
  67. clear {point::%uuid of argument 2 parsed as offline player%::value}
  68. clear {point::%uuid of argument 2 parsed as offline player%}
  69. send "§bSuppression du compte bancaire§3 %argument 2%§b effecutée.%nl%§bAncien chemin:§f %uuid of argument 2 parsed as offline player%" to sender and argument 2 parsed as offline player
  70. else:
  71. send "§cErreur: Ce compte bancaire n'existe pas." to sender
  72. else:
  73. loop {point::*}:
  74. if "%loop-value%" is "%argument 2 parsed as offline player%":
  75. set {_found} to "%loop-index%"
  76. exit loop
  77. if {_found} is set:
  78. clear {point::%uuid of argument 2 parsed as offline player%::value}
  79. clear {point::%uuid of argument 2 parsed as offline player%}
  80. send "§bSuppression du compte bancaire§3 %argument 2%§b effecutée.%nl%§bAncien chemin:§f %uuid of argument 2 parsed as offline player%" to sender
  81. else:
  82. send "§cErreur: Ce compte bancaire n'existe pas." to sender
  83. else:
  84. send "§cErreur: {@cmd_point} h,help,? [page=1] pour afficher l'aide." to sender
  85. else if argument 1 is "take" or "give" or "set":
  86. if argument 2 is set:
  87. if argument 3 parsed as number is set:
  88. loop {point::*}:
  89. if "%loop-value%" is "%argument 2 parsed as offline player%":
  90. set {_found} to "%loop-index%"
  91. exit loop
  92. if {_found} is set:
  93. if argument 1 is "take":
  94. if {point::%uuid of argument 2 parsed as offline player%::value} is bigger or equal to argument 3 parsed as number:
  95. set {_point} to argument 3 parsed as number * -1
  96. else if argument 1 is "give":
  97. set {_point} to argument 3 parsed as number
  98. if argument 1 is "take" or "give":
  99. if "%sender%" is not "%argument 2%":
  100. send "§bNouveau montant du joueur§3 %argument 2%§b:§3 %{point::%uuid of argument 2 parsed as offline player%::value} + {_point}%$%nl%§f%{_point}%$" to sender and argument 2 parsed as player
  101. else:
  102. send "§bNouveau montant du joueur§3 %argument 2%§b:§3 %{point::%uuid of argument 2 parsed as offline player%::value} + {_point}%$%nl%§f%{_point}%$" to sender
  103. set {point::%uuid of argument 2 parsed as offline player%::value} to {point::%uuid of argument 2 parsed as offline player%::value} + {_point}
  104. else if argument 3 parsed as number is bigger or equal to 0:
  105. if "%sender%" is not "%argument 2%":
  106. send "§bNouveau montant du joueur§3 %argument 2%§b:§3 %argument 3 parsed as number%$" to sender and argument 2 parsed as player
  107. else:
  108. send "§bNouveau montant du joueur§3 %argument 2%§b:§3 %argument 3 parsed as number%$" to sender
  109. set {point::%uuid of argument 2 parsed as offline player%::value} to argument 3 parsed as number
  110. else:
  111. send "§cErreur: Un compte bancaire ne peut être négatif." to sender
  112. else:
  113. send "§cErreur: Ce compte bancaire n'existe pas." to sender
  114. else:
  115. send "§cErreur: {@cmd_point} h,help,? [page=1] pour afficher l'aide." to sender
  116. else:
  117. send "§cErreur: {@cmd_point} h,help,? [page=1] pour afficher l'aide." to sender
  118. else if argument 1 is "top":
  119. if argument 2 parsed as number is set:
  120. if argument 2 parsed as number is bigger than 0:
  121. if argument 2 parsed as number is smaller or equal to rounded up (size of {point::*} / {@page_size}):
  122. loop {point::*}:
  123. set {_liste::%loop-value%} to {point::%loop-index%::value}
  124. while size of {_liste::*} is not 0:
  125. loop {_liste::*}:
  126. if {_max} is not set:
  127. set {_max} to loop-value
  128. set {_index} to loop-index
  129. else if loop-value is bigger or equal to {_max}:
  130. set {_max} to loop-value
  131. set {_index} to loop-index
  132. clear {_liste::%{_index}%}
  133. add {_max} to {_value::*}
  134. add {_index} to {_account::*}
  135. do [clear {_max}]->[clear {_index}]
  136. set {_index} to 0
  137. send "§8§m-------------------------%nl%§8Page %argument 2 parsed as number%/%rounded up (size of {point::*} / {@page_size})%" to sender
  138. loop size of {point::*} times:
  139. if {_index} >= argument 2 parsed as number * {@page_size} - {@page_size}:
  140. if {_index} < argument 2 parsed as number * {@page_size}:
  141. set {_checked} to {_index} + 1
  142. send "§b##%{_checked}% - %{_account::%{_checked}%}%:§f %{_value::%{_checked}%}%" to sender
  143. else:
  144. exit loop
  145. add 1 to {_index}
  146. send "§8§m-------------------------" to sender
  147. else:
  148. send "§cErreur: La page demandée n'a pas pu être affichée." to sender
  149. else:
  150. send "§cErreur: La page demandée n'a pas pu être affichée." to sender
  151. else:
  152. execute sender command "{@cmd_point} %argument 1% 1"
  153. else if argument 1 is not set:
  154. execute sender command "{@cmd_point} %player%"
  155. else:
  156. loop {point::*}:
  157. if "%{point::%uuid of argument 1 parsed as offline player%}%" is "%argument 1%":
  158. set {_found} to loop-index
  159. exit loop
  160. if {_found} is set:
  161. send "§bPoint de§3 %argument 1%§b:§f %{point::%uuid of argument 1 parsed as offline player%::value}%" to sender
  162. else:
  163. send "§cErreur: Ce compte bancaire n'existe pas." to sender
Advertisement
Add Comment
Please, Sign In to add comment