Advertisement
Enter212

[AdvancedRanks] v.2.0

Mar 6th, 2015
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.27 KB | None | 0 0
  1. #[AdvancedRanks][v2.0]
  2. # by Enter121
  3. # for NextCraft
  4.  
  5. on load:
  6. send "&f[&5Advanced&aRanks&f][v.2.0]&6 LADOWANIE " to console
  7. send "&f[&5Advanced&aRanks&f]&5Advanced&aRanks&f by &5&lEnter121 for &2Next&7Craft" to console
  8. on unload:
  9. send "&f[&5Advanced&aRanks&f]&6 WYLACZANIE" to console
  10. every 720 minutes:
  11. clear {_loopplayer::*}
  12. set {_loopplayer::*} to all files in "plugins/AdvancedRanks/PLAYERS/"
  13. loop {_loopplayer::*}:
  14. set {_nickname} to single value "nickname" get of "plugins/AdvancedRanks/PLAYERS/%loop-value%"
  15. set {_dateofexpired} to single value "dateofexpired" get of "plugins/AdvancedRanks/PLAYERS/%loop-value%"
  16. set {_cday} to subtext of "%now%" between 0 and 2 parsed as number
  17. set {_cmonth} to subtext of "%now%" between 4 and 5 parsed as number
  18. set {_datefromnow} to "%{_cday}%.%{_cmonth}%"
  19. if {_datefromnow} is {_dateofexpired}:
  20. execute console command "/pex user %{_nickname}% group set default"
  21. send "&f[&5Advanced&aRanks&f] %{_nickname}% zostal zdegradowany do rangi default" to console
  22. send "&f[&5Advanced&aRanks&f] %{_nickname}% zostal/a zdegradowany/a do rangi domyslnej" to all players
  23. df "plugins/AdvancedRanks/PLAYERS/%{_nickname}%.yml"
  24.  
  25. command /advrank <text> <text> <text> [<text>]:
  26. usage: &5&l/advrank <week/date/month> <gracz> <ranga> [<dzień.miesiąc>]
  27. trigger:
  28. if executor have permissions "advranks.promote" or "*" or "advranks.*":
  29. if arg 1 is "month":
  30. set {_ndate} to subtext of "%now%" between 0 and 5
  31. set "nickname" to "%argument 2%" in yaml file "plugins/AdvancedRanks/PLAYERS/%argument 2%.yml"
  32. set "rank" to "%argument 3%" in yaml file "plugins/AdvancedRanks/PLAYERS/%argument 2%.yml"
  33. set {_nday} to subtext of "%now%" between 0 and 2 parsed as number
  34. set {_nmonth} to subtext of "%now%" between 4 and 5 parsed as number
  35. set {_emonth} to {_nmonth}+1
  36. if {_nmonth} is "12":
  37. set {_emonth} to "1"
  38. set {_edate} to "%{_nday}%.%{_emonth}%"
  39. set "date" to "%{_nday}%.%{_nmonth}%" in yaml file "plugins/AdvancedRanks/PLAYERS/%argument 2%.yml"
  40. set "dateofexpired" to "%{_edate}%" in yaml file "plugins/AdvancedRanks/PLAYERS/%argument 2%.yml"
  41. send "%player%: mianowal %argument 2% na %argument 3% na 1 miesiac" to console
  42. send "&f[&5Advanced&aRanks&f] %argument 2% zostal/a mianowany/a na %argument 3% na 1 miesiąc" to all players
  43. execute console command "/pex user %argument 2% group set %argument 3%"
  44. exit
  45. if arg 1 is "date":
  46. set "nickname" to "%argument 2%" in yaml file "plugins/AdvancedRanks/PLAYERS/%argument 2%.yml"
  47. set "rank" to "%argument 3%" in yaml file "plugins/AdvancedRanks/PLAYERS/%argument 2%.yml"
  48. set {_nday} to subtext of "%now%" between 0 and 2 parsed as number
  49. set {_nmonth} to subtext of "%now%" between 4 and 5 parsed as number
  50. set "date" to "%{_nday}%.%{_nmonth}%" in yaml file "plugins/AdvancedRanks/PLAYERS/%argument 2%.yml"
  51. set "dateofexpired" to "%argument 4%" in yaml file "plugins/AdvancedRanks/PLAYERS/%argument 2%.yml"
  52. send "%player%: mianowal %argument 2% na %argument 3% do %argument 4%" to console
  53. send "&f[&5Advanced&aRanks&f] %argument 2% zostal/a mianowany/a na %argument 3% do %argument 4%" to all players
  54. execute console command "/pex user %argument 2% group set %argument 3%"
  55. exit
  56. if arg 1 is "week":
  57. set "nickname" to "%argument 2%" in yaml file "plugins/AdvancedRanks/PLAYERS/%argument 2%.yml"
  58. set "rank" to "%argument 3%" in yaml file "plugins/AdvancedRanks/PLAYERS/%argument 2%.yml"
  59. set {_nday} to subtext of "%now%" between 0 and 2 parsed as number
  60. set {_nmonth} to subtext of "%now%" between 4 and 5 parsed as number
  61. set {_eday} to "0"
  62. set {_emonth} to {_nmonth}
  63. set {_eday} to {_nday} +7
  64. if {_nmonth} is 1:
  65. set {_maxmonth} to 31
  66. if {_nmonth} is 2:
  67. set {_maxmonth} to 28
  68. if {_nmonth} is 3:
  69. set {_maxmonth} to 31
  70. if {_nmonth} is 4:
  71. set {_maxmonth} to 30
  72. if {_nmonth} is 5:
  73. set {_maxmonth} to 31
  74. if {_nmonth} is 6:
  75. set {_maxmonth} to 30
  76. if {_nmonth} is 7:
  77. set {_maxmonth} to 31
  78. if {_nmonth} is 8:
  79. set {_maxmonth} to 31
  80. if {_nmonth} is 9:
  81. set {_maxmonth} to 30
  82. if {_nmonth} is 10:
  83. set {_maxmonth} to 31
  84. if {_nmonth} is 11:
  85. set {_maxmonth} to 30
  86. if {_nmonth} is 12:
  87. set {_maxmonth} to 31
  88. if {_maxmonth} is less than {_eday}:
  89. set {_eday} to {_eday}-{_maxmonth}
  90. set {_emonth} to {_nmonth}+1
  91. set "date" to "%{_nday}%.%{_nmonth}%" in yaml file "plugins/AdvancedRanks/PLAYERS/%argument 2%.yml"
  92. set "dateofexpired" to "%{_eday}%.%{_emonth}%" in yaml file "plugins/AdvancedRanks/PLAYERS/%argument 2%.yml"
  93. send "%player%: mianowal %argument 2% na %argument 3% do %argument 4%" to console
  94. send "&f[&5Advanced&aRanks&f] %argument 2% zostal/a mianowany/a na %argument 3% na tydzień" to all players
  95. execute console command "/pex user %argument 2% group set %argument 3%"
  96. exit
  97. else:
  98. send "&f[&5Advanced&aRanks&f]&c Nie masz uprawnien" to player
  99. exit
  100.  
  101.  
  102. command /adv <text>:
  103. usage: &5&l/adv <reload/pomoc/info>
  104. trigger:
  105. if argument 1 is "pomoc":
  106. send "&a===========================================================" to executor
  107. send " &f[&5Advanced&aRanks&f]" to executor
  108. send "&a===========================================================" to executor
  109. send "&5/advrank month <gracz> <ranga> - ustawia rangę gracza na 1 miesiąc" to executor
  110. send "&5/advrank date <gracz> <ranga> <dzień.miesiąc> - ustawia rangę do daty określonej w komendzie" to executor
  111. send "&5/advrank week <gracz> <ranga> - ustawia rangę gracza na 1 tydzień" to executor
  112. send "&5/adv reload - przeładowuje AdvancedRanks" to executor
  113. send "&a===========================================================" to executor
  114. exit
  115. if argument 1 is "reload":
  116. if executor have permissions "advranks.reload" or "*" or "advranks.*":
  117. execute console command "/sk reload %script%"
  118. exit
  119. else:
  120. send "&f[&5Advanced&aRanks&f]&c Nie masz uprawnien" to player
  121. exit
  122. if argument 1 is "info":
  123. send "&f[&5Advanced&aRanks&f] stworzony przez Enter121 dla &f[&2Next&7Craft&f]" to executor
  124. exit
  125.  
  126. on join:
  127. send "&f[&5Advanced&aRanks&f] v.2.0"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement