knugi

Untitled

Mar 15th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.37 KB | None | 0 0
  1. options:
  2. tag: &8[&9Duels&8]
  3. folder: plugins/Duels
  4.  
  5. on script load:
  6. if folder "{@folder}" doesn't exists:
  7. create folder "{@folder}"
  8. create folder "{@folder}/kits"
  9. create folder "{@folder}/arens"
  10. create folder "{@folder}/users"
  11. create file "{@folder}/config.yml"
  12.  
  13.  
  14. command /duel [<player>]:
  15. trigger:
  16. if arg 1 isn't set:
  17. send "{@tag} &cPodaj gracza z ktorym chcesz walczyc."
  18. stop
  19. if player-arg 1 is online:
  20. if file "{@folder}/%player%.yml" doesn't exists:
  21. if file "{@folder}/%arg 1%.yml" doesn't exists:
  22. open chest with 3 rows named "&eWybierz zestaw" to player
  23. format slot 0 of player with bread to close
  24. else:
  25. send "{@tag} &cTen gracz jest juz podczas walki."
  26. stop
  27. else:
  28. send "{@tag} &cJestes juz podczas walki."
  29. stop
  30. else:
  31. send "{@tag} &cTen gracz jest offline."
  32. stop
  33. command /zestaw [<text>] [<text>]:
  34. trigger:
  35. if player has permission "duels.*" or "duels.kit":
  36. if arg 1 isn't set:
  37. send "{@tag} &cPoprawne uzycie: &7/zestaw <add/remove> <nazwaZestawu>"
  38. stop
  39. if arg 1 is "add" or "set":
  40. if arg 2 is set:
  41. if arg 2's length is bigger than or equal to 3:
  42. create file "{@folder}/kits/%arg 2%.yml"
  43. set {_n} to arg 2
  44. set "kit.nazwa" to "%{_n}%" in yaml file "{@folder}/kits/%arg 2%.yml"
  45. set {_i} to 1
  46. loop all items in player's inventory:
  47. set "kit.items.%{_i}%" to "%loop-item%" in yaml file "{@folder}/kits/%arg 2%.yml"
  48. add 1 to {_i}
  49. #set {_its::*} to all items in the player's inventory
  50. #set "kit.items" to "%{_its::*}%" in yaml file "{@folder}/kits/%arg 2%.yml"
  51. set "kit.autor" to "%player%" in yaml file "{@folder}/kits/%arg 2%.yml"
  52. send "{@tag} &aStworzyles nowy zestaw o nazwie: &1%arg 2%"
  53. stop
  54. else:
  55. send "{@tag} &cNazwa musi zawierac min. 3 znaki."
  56. stop
  57. if arg 1 is "info":
  58. if arg 2 is set:
  59. if file "{@folder}/kits/%arg 2%.yml" exists:
  60. send ""
  61. send "&eZestaw: &7%arg 2%"
  62. set {_n} to single value "kit.nazwa" get of "{@folder}/kits/%arg 2%.yml"
  63. set {_c::*} to configuration section "kit.items" get of "{@folder}/kits/%arg 2%.yml"
  64. loop {_c::*}:
  65. add single value "kit.items.%loop-index%" get of "{@folder}/kits/%arg 2%.yml" to {_items::*}
  66. set {_b} to single value "kit.autor" get of "{@folder}/kits/%arg 2%.yml"
  67. send "&eNazwa: &7%{_n}%"
  68. send "&ePrzedmioty: &7%{_items::*}%"
  69. send "&eAutor: &7%{_b}%"
  70. else:
  71. set {_kitsy::*} to all files in "{@folder}/kits"
  72. loop {_kitsy::*}:
  73. replace all ".yml" in {_kitsy::%loop-index%} with ""
  74. send "{@tag} &cDostepne zestawy: &7%{_kitsy::*}%"
  75. if arg 1 is "daj":
  76. if arg 2 is set:
  77. if file "{@folder}/kits/%arg 2%.yml" exists:
  78. set {_its::*} to configuration section "kit.items" get of "{@folder}/kits/%arg 2%.yml"
  79. loop {_its::*}:
  80. set {_i} to single value "kit.items.%loop-index%" get of "{@folder}/kits/%arg 2%.yml" parsed as item type
  81. send "%{_i}%"
  82. give {_i} to player
  83. send "{@tag} &aOtrzymales zestaw &7%arg 2%"
  84. else:
  85. set {_kitsy::*} to all files in "{@folder}/kits"
  86. loop {_kitsy::*}:
  87. replace all ".yml" in {_kitsy::%loop-index%} with ""
  88. if {_kitsy::*} is not set:
  89. add "-" to {_kitsy::*}
  90. send "{@tag} &cDostepne zestawy: &7%{_kitsy::*}%"
Advertisement
Add Comment
Please, Sign In to add comment