AdamGrzegorz

CraftRank

Dec 15th, 2014
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.51 KB | None | 0 0
  1. # _____ _____ ______ _______ _____ _ _ _ __
  2. # / ____| __ \ /\ | ____|__ __| __ \ /\ | \ | | |/ /
  3. # | | | |__) | / \ | |__ | | | |__) | / \ | \| | ' /
  4. # | | | _ / / /\ \ | __| | | | _ / / /\ \ | . ` | <
  5. # | |____| | \ \ / ____ \| | | | | | \ \ / ____ \| |\ | . \
  6. # \_____|_| \_\/_/ \_\_| |_| |_| \_\/_/ \_\_| \_|_|\_\
  7.  
  8.  
  9. on load:
  10. set {format-top10} to colored value "format-top10" get of "plugins/Skript/scripts/CraftRank/config.yml"
  11. set {format-top10header} to colored value "format-top10header" get of "plugins/Skript/scripts/CraftRank/config.yml"
  12. set {format-top10null} to value "format-top10null" get of "plugins/Skript/scripts/CraftRank/config.yml"
  13. set {piorun} to value "piorun" get of "plugins/Skript/scripts/CraftRank/config.yml" parsed as boolean
  14. set {procent} to value "procent" get of "plugins/Skript/scripts/CraftRank/config.yml" parsed as number
  15. set {deathformat} to value "format-death" get of "plugins/Skript/scripts/CraftRank/config.yml"
  16. set {relogformat} to value "format-relog" get of "plugins/Skript/scripts/CraftRank/config.yml"
  17. set {relogpoints} to value "relog-points" get of "plugins/Skript/scripts/CraftRank/config.yml"
  18. set {killstreak} to value "format-killstreak" get of "plugins/Skript/scripts/CraftRank/config.yml"
  19. set {relogseconds} to value "relog-seconds" get of "plugins/Skript/scripts/CraftRank/config.yml" parsed as number
  20. set {o-procent} to value "odejmowany-procent" get of "plugins/Skript/scripts/CraftRank/config.yml" parsed as number
  21. set {2kill} to value "2kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  22. set {3kill} to value "3kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  23. set {4kill} to value "4kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  24. set {5kill} to value "5kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  25. set {6kill} to value "6kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  26. set {7kill} to value "7kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  27. set {8kill} to value "8kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  28. set {9kill} to value "9kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  29. set {10kill} to value "10kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  30. set {maxkill} to value "maxkill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  31.  
  32. set {p2kill} to value "P2kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  33. set {p3kill} to value "P3kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  34. set {p4kill} to value "P4kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  35. set {p5kill} to value "P5kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  36. set {p6kill} to value "P6kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  37. set {p7kill} to value "P7kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  38. set {p8kill} to value "P8kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  39. set {p9kill} to value "P9kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  40. set {p10kill} to value "P10kill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  41. set {pmaxkill} to value "Pmaxkill" get of "plugins/Skript/scripts/CraftRank/config.yml"
  42.  
  43.  
  44.  
  45. command /craftrank [<text>]:
  46. aliases: cr, craftr, crank
  47. trigger:
  48. if player has permission "craftrank.admin":
  49. if arg 1 is "reset":
  50. clear {CraftRank::*}
  51. send "&cZresetowano!"
  52. wait 3 seconds
  53. kick all players due to "&4[CraftRank] &6Wejdz jeszcze raz! :)"
  54. stop
  55. if arg 1 is "plik":
  56. download from "http://pastebin.com/raw.php?i=9fEkBae6" to "plugins/Skript/scripts/CraftRank/config.yml"
  57. send "&aUtworzono/Zresetowano plik konfiguracyjny."
  58. send "&7CraftRank &b1.0.0 &7by &bAdamek/AdamGrzegorz"
  59. send "&7YouTube: &bhttp://www.youtube.com/AdameQTM"
  60. stop
  61.  
  62. command /ranking [<integer>]:
  63. usage: /ranking [Liczba wyszukiwanych wynikow]
  64. trigger:
  65. if arg 1 is set:
  66. set {_x} to {format-top10header}
  67. replace all "{LINES}" with "%arg 1%" in {_x}
  68. send "%colored {_x}%"
  69. loop {CraftRank::Punkty::*}:
  70. set {_o::%loop-index%} to loop-value
  71. set {_num} to size of {_o::*}
  72. loop {_num} times:
  73. loop {_o::*}:
  74. {_value.%loop-number%} is not set:
  75. set {_value.%loop-number%} to loop-value
  76. set {_index.%loop-number%} to loop-index
  77. loop-value is more than {_value.%loop-number%}:
  78. set {_value.%loop-number%} to loop-value
  79. set {_index.%loop-number%} to loop-index
  80. delete {_o::%{_index.%loop-number%}%}
  81. loop arg 1 times:
  82. if loop-number is less than or equal to {_num}:
  83. set {_f} to {format-top10}
  84. replace all "{NICK}" with "%{CraftRank::Nick::%{_index.%loop-number%}%}%" in {_f}
  85. replace all "{POINTS}" with "%{_value.%loop-number%}%" in {_f}
  86. replace all "{POSITION}" with "%loop-number%" in {_f}
  87. send "%colored {_f}%"
  88. else:
  89. set {_u} to {format-top10null}
  90. replace all "{POSITION}" with "%loop-number%" in {_u}
  91. send "%colored {_u}%"
  92.  
  93.  
  94.  
  95. on death:
  96. victim is player
  97. if {piorun} is true:
  98. strike lightning effect at the victim
  99. drop victim's skull named "&7Glowa gracza: &b%victim%" at location of victim
  100. add 1 to {CraftRank::Killstreak::%attacker%}
  101. add 1 to {CraftRank::Smierci::%victim%}
  102. add 1 to {CraftRank::Zabojstwa::%attacker%}
  103. set {_apoints} to rounded down {CraftRank::Punkty::%victim%}*{procent}
  104. set {_vpoints} to rounded down {_apoints}/2
  105. if {CraftRank::Killstreak::%attacker%} is equal to 2:
  106. set {_killstreak} to {killstreak}
  107. replace all "{KILLSTREAK}" with "%colored {2kill}%" in {_killstreak}
  108. send "%colored {_killstreak}%" to attacker
  109. add {p2kill} to {CraftRank::Punkty::%attacker%}
  110. if {CraftRank::Killstreak::%attacker%} is equal to 3:
  111. set {_killstreak} to {killstreak}
  112. replace all "{KILLSTREAK}" with "%colored {3kill}%" in {_killstreak}
  113. send "%colored {_killstreak}%" to attacker
  114. add {p3kill} to {CraftRank::Punkty::%attacker%}
  115. if {CraftRank::Killstreak::%attacker%} is equal to 4:
  116. set {_killstreak} to {killstreak}
  117. replace all "{KILLSTREAK}" with "%colored {4kill}%" in {_killstreak}
  118. send "%colored {_killstreak}%" to attacker
  119. add {p4kill} to {CraftRank::Punkty::%attacker%}
  120. if {CraftRank::Killstreak::%attacker%} is equal to 5:
  121. set {_killstreak} to {killstreak}
  122. replace all "{KILLSTREAK}" with "%colored {5kill}%" in {_killstreak}
  123. send "%colored {_killstreak}%" to attacker
  124. add {p5kill} to {CraftRank::Punkty::%attacker%}
  125. if {CraftRank::Killstreak::%attacker%} is equal to 6:
  126. set {_killstreak} to {killstreak}
  127. replace all "{KILLSTREAK}" with "%colored {6kill}%" in {_killstreak}
  128. send "%colored {_killstreak}%" to attacker
  129. add {p6kill} to {CraftRank::Punkty::%attacker%}
  130. if {CraftRank::Killstreak::%attacker%} is equal to 7:
  131. set {_killstreak} to {killstreak}
  132. replace all "{KILLSTREAK}" with "%colored {7kill}%" in {_killstreak}
  133. send "%colored {_killstreak}%" to attacker
  134. add {p7kill} to {CraftRank::Punkty::%attacker%}
  135. if {CraftRank::Killstreak::%attacker%} is equal to 8:
  136. set {_killstreak} to {killstreak}
  137. replace all "{KILLSTREAK}" with "%colored {8kill}%" in {_killstreak}
  138. send "%colored {_killstreak}%" to attacker
  139. add {p8kill} to {CraftRank::Punkty::%attacker%}
  140. if {CraftRank::Killstreak::%attacker%} is equal to 9:
  141. set {_killstreak} to {killstreak}
  142. replace all "{KILLSTREAK}" with "%colored {9kill}%" in {_killstreak}
  143. send "%colored {_killstreak}%" to attacker
  144. add {p9kill} to {CraftRank::Punkty::%attacker%}
  145. if {CraftRank::Killstreak::%attacker%} is equal to 10:
  146. set {_killstreak} to {killstreak}
  147. replace all "{KILLSTREAK}" with "%colored {10kill}%" in {_killstreak}
  148. send "%colored {_killstreak}%" to attacker
  149. add {p10kill} to {CraftRank::Punkty::%attacker%}
  150. if {CraftRank::Killstreak::%attacker%} is equal to 11:
  151. set {_killstreak} to {killstreak}
  152. replace all "{KILLSTREAK}" with "%colored {maxkill}%" in {_killstreak}
  153. send "%colored {_killstreak}%" to attacker
  154. add {pmaxkill} to {CraftRank::Punkty::%attacker%}
  155. set {CraftRank::Killstreak::%attacker%} to 0
  156. remove {_vpoints} from {CraftRank::Punkty::%victim%}
  157. add {_apoints} to {CraftRank::Punkty::%attacker%}
  158. set {_df} to {deathformat}
  159. replace all "{VNICK}" with "%victim%" in {_df}
  160. replace all "{ANICK}" with "%attacker%" in {_df}
  161. replace all "{APOINTS}" with "%{_apoints}%" in {_df}
  162. replace all "{VPOINTS}" with "%{_vpoints}%" in {_df}
  163. set death message to "%colored {_df}%"
  164. set {CraftRank::Killstreak::%victim%} to 0
  165. if {CraftRank::AntyRelog::%victim%} is true:
  166. delete {CraftRank::AntyRelog::%victim%}
  167. stop
  168. stop
  169.  
  170.  
  171. on quit:
  172. if {CraftRank::AntyRelog::%player%} is true:
  173. if {piorun} is true:
  174. strike lightning effect at the player
  175. kill player
  176. remove {relogpoints} from {CraftRank::Punkty::%player%}
  177. set {_rf} to {relogformat}
  178. replace all "{NICK}" with "%player%" in {_rf}
  179. replace all "{POINTS}" with "%{_relogpoints}%" in {_rf}
  180. broadcast "%colored {_rf}%"
  181. stop
  182.  
  183. on damage of player:
  184. if {CraftRank::AntyRelog::%victim%} is false:
  185. send "&cJestes podczas walki, nie mozesz sie wylogowac!" to victim
  186. set {CraftRank::AntyRelog::%victim%} to true
  187. wait 15 seconds
  188. if {CraftRank::AntyRelog::%victim%} is true:
  189. send "&aJuz nie jestes podczas walki, mozesz sie wylogowac!" to victim
  190. delete {CraftRank::AntyRelog::%victim%}
  191. stop
  192.  
  193.  
  194. on join:
  195. if {CraftRank::Smierci::%player%} is not set:
  196. set {CraftRank::Smierci::%player%} to 0
  197. stop
  198. if {CraftRank::Zabojstwa::%player%} is not set:
  199. set {CraftRank::Zabojstwa::%player%} to 0
  200. stop
  201. if {CraftRank::Punkty::%player%} is not set:
  202. set {CraftRank::Punkty::%player%} to 1000
  203. stop
  204. if {CraftRank::AntyRelog::%player%} is set:
  205. delete {CraftRank::AntyRelog::%player%}
  206. stop
  207. set {CraftRank::Nick::%player%} to player
  208. set {CraftRank::Killstreak::%player%} to 0
  209. stop
  210.  
  211. command /gracz [<offline player=%player%>]:
  212. aliases: ginfo, infogracz
  213. trigger:
  214. if arg 1 is set:
  215. if {CraftRank::Punkty::%arg 1%} is set:
  216. send "&8======[ &6%arg 1% &8]======"
  217. send "&7Punkty: &6%{CraftRank::Punkty::%arg 1%}%"
  218. send "&7Zabojstwa: &6%{CraftRank::Zabojstwa::%arg 1%}%"
  219. send "&7Smierci: &6%{CraftRank::Smierci::%arg 1%}%"
  220. if {CraftRank::Punkty::%arg 1%} is not set:
  221. send "&cTaki gracz nigdy nie gral na serwerze!"
  222. stop
  223. else:
  224. send "&8======[ &6%player% &8]======"
  225. send "&8> &7Punkty: &6%{CraftRank::Punkty::%arg 1%}%"
  226. send "&8> &7Zabojstwa: &6%{CraftRank::Zabojstwa::%arg 1%}%"
  227. send "&8> &7Smierci: &6%{CraftRank::Smierci::%arg 1%}%"
  228. stop
Advertisement
Add Comment
Please, Sign In to add comment