Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.31 KB | None | 0 0
  1. function islandSettingsMenu(p: player, loc: location):
  2. set {_plot} to {api::P2}.getPlot({_loc})
  3. set {_uuid} to {_p}.getUniqueId()
  4.  
  5. if {_plot} is not set:
  6. send "&cMusisz byc na wyspie, aby wykonac ta komende." to {_p}
  7. stop
  8.  
  9. if {_plot}.isOwner({_uuid}) is false:
  10. send "&cMusisz byc wlascicielem wyspy, aby wykonac ta komende." to {_p}
  11. stop
  12.  
  13. open virtual chest inventory named "&lWyspy: &RUstawienia" with 6 rows to {_p}
  14. make gui slot 4 of {_p} with clock named "&aPora dnia" to timeSettingMenu({_p}, {_loc})
  15. make gui slot 11 of {_p} with iron sword named "&aPVP" to nothing
  16. make gui slot 12 of {_p} with redstone named "&aRedstone" with lore "&7Zezwala gosciom uzywac dzwignie, przyciski, comparatory, repeatery" to nothing
  17. make gui slot 13 of {_p} with zombie head named "&aZabijanie mobow" with lore "&7Zezwala gosciom zabijac mobow." to nothing
  18. make gui slot 14 of {_p} with golden sword named "&aZabijanie zwierzat" with lore "&7Zezwala gosciom zabijac mobow." to nothing
  19. make gui slot 15 of {_p} with red bed item named "&aOdwiedzanie" with lore "&7Zezwala innym odwiedzac twoja wyspe." to nothing
  20. make gui slot 49 of {_p} with arrow named "%{settings::secondColor}%Wroc" to run function openIslands({_p})
  21.  
  22. set {_pvp} to FlagManager.getFlag("allowPvp")
  23. set {_pvp} to FlagManager.getPlotFlagRaw({_plot} and {_pvp})
  24. if "%{_pvp}%" is "true":
  25. make gui slot 20 of {_p} with dye:10 named "&aWlaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "allowPvp", false)
  26. else:
  27. make gui slot 20 of {_p} with gray dye named "&cWylaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "allowPvp", true)
  28.  
  29. set {_redstone} to FlagManager.getFlag("redstoneVisitors")
  30. set {_redstone} to FlagManager.getPlotFlagRaw({_plot} and {_redstone})
  31. if "%{_redstone}%" is "true":
  32. make gui slot 21 of {_p} with dye:10 named "&aWlaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "redstoneVisitors", false)
  33. else:
  34. make gui slot 21 of {_p} with gray dye named "&cWylaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "redstoneVisitors", true)
  35.  
  36. set {_mobKill} to FlagManager.getFlag("mobKill")
  37. set {_mobKill} to FlagManager.getPlotFlagRaw({_plot} and {_mobKill})
  38. if "%{_mobKill}%" is "true":
  39. make gui slot 22 of {_p} with dye:10 named "&aWlaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "mobKill", false)
  40. else:
  41. make gui slot 22 of {_p} with gray dye named "&cWylaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "mobKill", true)
  42.  
  43. set {_animalKill} to FlagManager.getFlag("animalKill")
  44. set {_animalKill} to FlagManager.getPlotFlagRaw({_plot} and {_animalKill})
  45. if "%{_animalKill}%" is "true":
  46. make gui slot 23 of {_p} with dye:10 named "&aWlaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "animalKill", false)
  47. else:
  48. make gui slot 23 of {_p} with gray dye named "&cWylaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "animalKill", true)
  49.  
  50. set {_visit} to FlagManager.getFlag("visit")
  51. set {_visit} to FlagManager.getPlotFlagRaw({_plot} and {_visit})
  52. if "%{_visit}%" is "true":
  53. make gui slot 24 of {_p} with dye:10 named "&aWlaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "visit", false)
  54. else:
  55. make gui slot 24 of {_p} with gray dye named "&cWylaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "visit", true)
  56.  
  57.  
  58. function islandSettingsChange(p: player, loc: location, flag: text, b: boolean) :: boolean:
  59. set {_plot} to {api::P2}.getPlot({_loc})
  60. if {_flag} is "allowPvp":
  61. set {_flag} to FlagManager.getFlag({_flag})
  62. FlagManager.addPlotFlag({_plot}, {_flag}, {_b})
  63. if {_b} is true:
  64. make gui slot 20 of {_p} with dye:10 named "&aWlaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "allowPvp", false)
  65. else:
  66. make gui slot 20 of {_p} with gray dye named "&cWylaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "allowPvp", true)
  67.  
  68. if {_flag} is "redstoneVisitors":
  69. set {_flag} to FlagManager.getFlag({_flag})
  70. FlagManager.addPlotFlag({_plot}, {_flag}, {_b})
  71. if {_b} is true:
  72. make gui slot 21 of {_p} with dye:10 named "&aWlaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "redstoneVisitors", false)
  73. else:
  74. make gui slot 21 of {_p} with gray dye named "&cWylaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "redstoneVisitors", true)
  75.  
  76. if {_flag} is "mobKill":
  77. set {_flag} to FlagManager.getFlag({_flag})
  78. FlagManager.addPlotFlag({_plot}, {_flag}, {_b})
  79. if {_b} is true:
  80. make gui slot 22 of {_p} with dye:10 named "&aWlaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "mobKill", false)
  81. else:
  82. make gui slot 22 of {_p} with gray dye named "&cWylaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "mobKill", true)
  83.  
  84. if {_flag} is "animalKill":
  85. set {_flag} to FlagManager.getFlag({_flag})
  86. FlagManager.addPlotFlag({_plot}, {_flag}, {_b})
  87. if {_b} is true:
  88. make gui slot 23 of {_p} with dye:10 named "&aWlaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "animalKill", false)
  89. else:
  90. make gui slot 23 of {_p} with gray dye named "&cWylaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "animalKill", true)
  91.  
  92. if {_flag} is "visit":
  93. set {_flag} to FlagManager.getFlag({_flag})
  94. FlagManager.addPlotFlag({_plot}, {_flag}, {_b})
  95. if {_b} is true:
  96. make gui slot 24 of {_p} with dye:10 named "&aWlaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "visit", false)
  97. else:
  98. make gui slot 24 of {_p} with gray dye named "&cWylaczone" with lore "&7Kliknij, aby zmienic" to run function islandSettingsChange({_p}, {_loc}, "visit", true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement