knugi

Untitled

Mar 13th, 2017
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.27 KB | None | 0 0
  1. #ZROBIONE#
  2. # - zakladanie /do ulepszenia duzo
  3. # - usuwanie /do ulepszenia
  4. # - else if usuwanie ;c*
  5. #ogien sojusznicy
  6. #zakladanie gildii
  7. #tagi nad glowa
  8. #zapisy do plikow...
  9. #narazie tyle
  10. #tworzenie gildii zapis do pliku .yml
  11.  
  12. options:
  13. folder: plugins/Skript/scripts/foxGuilds
  14. wiad: plugins/Skript/scripts/foxGuilds/messages.yml
  15. cfg: plugins/Skript/scripts/foxGuilds/config.yml
  16. gildie: plugins/Skript/scripts/foxGuilds/gildie.yml
  17. users: plugins/Skript/scripts/foxGuilds/user.yml
  18. invited: plugins/Skript/scripts/foxGuilds/invited.yml
  19. urank: plugins/Skript/scripts/foxGuilds/urank.yml
  20.  
  21. on script load:
  22. if folder "{@folder}" doesn't exists:
  23. create folder "{@folder}"
  24. create file "{@cfg}"
  25. create file "{@gildie}"
  26. create file "{@wiad}"
  27. create file "{@users}"
  28. create file "{@invited}"
  29. create file "{@urank}"
  30. set "permissionVip" to "guilds.Vip" in yaml file "{@cfg}"
  31. set "startRank" to "1000" in yaml file "{@cfg}"
  32. set "bc.wGCreate" to "" in yaml file "{@wiad}"
  33. set "w.wGHelp" to "" in yaml file "{@wiad}"
  34. set "cfg.guildItems.1" to "32 diamond" in yaml file "{@cfg}"
  35. set "cfg.guildItems.2" to "64 stone" in yaml file "{@cfg}"
  36. set "cfg.guildItemsVip.1" to "16 diamond" in yaml file "{@cfg}"
  37. set "cfg.guildItemsVip.2" to "32 stone" in yaml file "{@cfg}"
  38.  
  39. command /gildia [<text>] [<text>] [<text>] [<text>]:
  40. aliases: g
  41. trigger:
  42. if arg 1 is not set:
  43. send "&e/gildia zaloz <tag> <nazwa> &7- zaklada gildie%nl%&e/gildia usun <tag> &7- usuwa gildie"
  44. stop
  45. if arg 1 is "zaloz":
  46. if arg 2 is set:
  47. if arg 2's length is bigger than 2:
  48. if arg 2's length is smaller than 5:
  49. if arg 3 is set:
  50. if arg 3's length is smaller or equal to 16:
  51. if arg 3's length is bigger than 6:
  52. if yaml path "users.%player%" in file "{@users}" doesn't exist:
  53. set {_g::*} to configuration section "gildia" get of "{@gildie}"
  54. loop {_g::*}:
  55. set {_tag} to single value "gildia.%loop-value%.tag" get of "{@gildie}"
  56. if "%{_tag}%" is "%arg 2%":
  57. send "&c* &7Gildia z podanym tagiem juz istnieje."
  58. stop
  59. loop {_g::*}:
  60. set {_nazwa} to single value "gildia.%loop-value%.nazwa" get of "{@gildie}"
  61. if "%{_nazwa}%" is "%arg 3%":
  62. send "&c* &7Taka nazwa gildi juz istnieje."
  63. stop
  64. set {_perm} to single value "permissionVip" get of "{@cfg}"
  65. if player doesn't have permission "%{_perm}%":
  66. set {_p::*} to configuration section "cfg.guildItems" get of "{@cfg}"
  67. loop {_p::*}:
  68. set {_i} to single value "cfg.guildItems.%loop-index%" get of "{@cfg}" parsed as item type
  69. if player doesn't have {_i}:
  70. send "&cNie posiadasz: &6%{_i}%"
  71. set {_error} to true
  72. else:
  73. set {_p::*} to configuration section "cfg.guildItemsVip" get of "{@cfg}"
  74. loop {_p::*}:
  75. set {_i} to single value "cfg.guildItemsVip.%loop-index%" get of "{@cfg}" parsed as item type
  76. if player doesn't have {_i}:
  77. send "&cNie posiadasz: &6%{_i}%"
  78. set {_error} to true
  79. if {_error} is set:
  80. stop
  81. stop
  82. wait 10 tick
  83. set "gildia.%arg 2%.tag" to "%arg 2%" in yaml file "{@gildie}"
  84. set "gildia.%arg 2%.nazwa" to "%arg 3%" in yaml file "{@gildie}"
  85. set "gildia.%arg 2%.zalozyciel" to "%player%" in yaml file "{@gildie}"
  86. set "gildia.%arg 2%.lider" to "%player%" in yaml file "{@gildie}"
  87. set "users.%player%.nick" to "%player%" in yaml file "{@users}"
  88. set "users.%player%.gildia" to "%arg 2%" in yaml file "{@users}"
  89. add "%player%" to yaml list "gildia.%arg 2%.czlonkowie" from "foxGuilds/gildie.yml"
  90. broadcast "&aGracz &7%player% &astworzyl gildie o nazwie &7%arg 3% &a i tagu &7%arg 2%"
  91. else:
  92. send "&8>> &cPosiadasz juz gildie."
  93. stop
  94. else:
  95. send "&8>> &cNazwa gildii musi zawierac od 6 do 16 znakow."
  96. stop
  97. else:
  98. send "&8>> &cNazwa gildii musi zawierac od 6 do 16 znakow."
  99. stop
  100. else:
  101. send "&8>> &cPoprawne uzycie: &7/gildia zaloz <tag> <nazwa>"
  102. stop
  103. else:
  104. send "&8>> &cTag gildii musi zawierac od 3 do 4 znakow."
  105. stop
  106. else:
  107. send "&8>> &cTag gildii musi zawierac od 3 do 4 znakow."
  108. stop
  109. else:
  110. send "&8>> &cPoprawne uzycie: &7/gildia zaloz <tag> <nazwa>"
  111. stop
  112. if arg 1 is "usun":
  113. if arg 2 is set:
  114. set {_g::*} to configuration section "gildia" get of "{@gildie}"
  115. loop {_g::*}:
  116. set {_tag} to single value "gildia.%loop-value%.tag" get of "{@gildie}"
  117. if yaml path "gildia.%arg 2%" in file "{@gildie}" exists:
  118. if "%arg 2%" is "%{_tag}%":
  119. set {_zal} to single value "gildia.%loop-value%.zalozyciel" get of "{@gildie}"
  120. set {_lid} to single value "gildia.%loop-value%.lider" get of "{@gildie}"
  121. if "%player%" is "%{_lid}%" or "%{_zal}%":
  122. send "&8>> &aUsunales swoja gildie!"
  123. delete yaml value "gildia.%arg 2%" from file "foxGuilds/guilds.yml"
  124. delete yaml value "users.%player%" from file "foxGuilds/user.yml"
  125. stop
  126. else:
  127. send "&8>> &cNie masz uprawnien lidera/zalozyciela"
  128. stop
  129. else:
  130. send "&8>> &cPodana gildia nie instnieje."
  131. stop
  132. else:
  133. send "&8>> &cPodana gildia nie istnieje."
  134. stop
  135. else:
  136. send "&8>> &cPoprawne uzycie: &7/gildia usun <tag>"
  137. stop
  138. if arg 1 is "zapros":
  139. if arg 2 is set:
  140. set {_c} to arg 2 parsed as player
  141. if {_c} is online:
  142. if true is true: #Huehuehuehuehuehue Knugi To Chuj i Chuj Ci do Tego <3
  143. if yaml path "users.%{_c}%" in file "{@users}" doesn't exist:
  144. send "&aZapraszalny"
  145. #TODO cale zaproszenie
  146. else:
  147. send "7cma gildie"
  148. else:
  149. send "&8>> &cTen gracz nie jest online."
  150. stop
  151. else:
  152. send "&8>> &cMusisz podac nick gracza ktorego chcesz zaprosic."
  153. stop
  154. #EVENTY RANKINGOWE
  155. on join:
  156. if yaml path "ranking.%player%" in file "{@urank}" doesn't exist:
  157. set {_dt} to single value "startRank" get of "{@cfg}"
  158. set "ranking.%player%" to "%{_dt}%" in yaml file "{@urank}"
  159. send "&7Domyslny ranking ustawiony!"
Advertisement
Add Comment
Please, Sign In to add comment