knugi

Untitled

Mar 15th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 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 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 {_its::*} to all items in the player's inventory
  46. set "kit.items" to "%{_its::*}%" in yaml file "{@folder}/kits/%arg 2%.yml"
  47. set "kit.autor" to "%player%" in yaml file "{@folder}/kits/%arg 2%.yml"
  48. send "{@tag} &aStworzyles nowy zestaw o nazwie: &1%arg 2%"
  49. stop
  50. else:
  51. send "{@tag} &cNazwa musi zawierac min. 3 znaki."
  52. stop
  53. if arg 1 is "info":
  54. if arg 2 is set:
  55. if file "{@folder}/kits/%arg 2%.yml" exists:
  56. send ""
  57. send "&eZestaw: &7%arg 2%"
  58. set {_n} to single value "kit.nazwa" get of "{@folder}/kits/%arg 2%.yml"
  59. set {_c} to single value "kit.items" get of "{@folder}/kits/%arg 2%.yml"
  60. set {_b} to single value "kit.autor" get of "{@folder}/kits/%arg 2%.yml"
  61. send "&eNazwa: &7%{_n}%"
  62. send "&ePrzedmioty: &7%{_c}%"
  63. send "&eAutor: &7%{_b}%"
  64. else:
  65. set {_kitsy::*} to all files in "{@folder}/kits"
  66. loop {_kitsy::*}:
  67. replace all ".yml" in {_kitsy::%loop-index%} with ""
  68. send "{@tag} &cDostepne zestawy: &7%{_kitsy::*}%"
  69. if arg 1 is "daj":
  70. if arg 2 is set:
  71. if file "{@folder}/kits/%arg 2%.yml" exists:
  72. set {_its::*} to yaml value "kit.items" from "{@folder}/kits/%arg 2%.yml"
  73. give {_its::*} to player
  74. send "{@tag} &aOtrzymales zestaw &7%arg 2%"
  75. else:
  76. set {_kitsy::*} to all files in "{@folder}/kits"
  77. send "{@tag} &cDostepne zestawy: &7%{_kitsy::*}%"
Advertisement
Add Comment
Please, Sign In to add comment