# # PQAlert by ProxEQ # edit zzAlert ~Turas # # # Komendy: /alert - główna komenda # Permije: - skript.alert.operator - dostęp do głównej komendy # options: LogoX: &c&lSer&4&lwer &8&l»&r chestName: &3&lSer&b&lwer &8&l» &c&lAlert possibleSendMessButton: dye:10 named "&a&lWyślij ALERT &7&m--&r&7>" cantSendMessButton: dye:1 named "&c&lWyślij ALERT &7&m---&r&7>" with lore "&4Nie można wysłać, wybierz przynajmniej jedną opcję!" notChatOption: paper named "&c&lWyślij na &4&lCHACIE" chatOption: paper of infinity 1 named "&a&lWyślij na &2&lCHACIE" notTitleOption: beacon named "&c&lWyświetl na &4&lTITLE" titleOption: beacon of infinity 1 named "&a&lWyświetl na &2&lTITLE" notActionbarOption: wood sword named "&c&lWyświetl na &4&lACTION BARZE" actionbarOption: wood sword of infinity 1 named "&a&lWyświetl na &2&lACTION BARZE" separator: iron bars block positiveSeparator: light green stained glass pane negativeSeparator: red stained glass pane command /alert []: permission: skript.alert.operator permission message: &4Sorrry, you don't have permission! description: Wysyłaj alerty! trigger: if arg 1 is not set: send "{@LogoX} &7Poprawne uzycie: &a/alert [wiadomosc]" stop if arg 1 is set: if {_x} is not set: wait 1 tick open chest with 3 rows named "{@chestName}" to player wait 1 tick set {_x} to arg 1 replace all "$online" with "%amount of all players%" in {_x} set {aalert::%player%::message} to {_x} cantSendMessageFunction(player) set slot 1 of player's current inventory to {@separator} set slot 3 of player's current inventory to {@separator} set slot 5 of player's current inventory to {@separator} set slot 10 of player's current inventory to {@separator} set slot 12 of player's current inventory to {@separator} set slot 14 of player's current inventory to {@separator} set slot 19 of player's current inventory to {@separator} set slot 21 of player's current inventory to {@separator} set slot 23 of player's current inventory to {@separator} set slot 0 of player's current inventory to {@negativeSeparator} set slot 2 of player's current inventory to {@negativeSeparator} set slot 4 of player's current inventory to {@negativeSeparator} set slot 18 of player's current inventory to {@negativeSeparator} set slot 20 of player's current inventory to {@negativeSeparator} set slot 22 of player's current inventory to {@negativeSeparator} set slot 9 of player's current inventory to {@notChatOption} set slot 11 of player's current inventory to {@notTitleOption} set slot 13 of player's current inventory to {@notActionbarOption} set slot 16 of player's current inventory to {@cantSendMessButton} stop on inventory click: if inventory name of player's current inventory is "{@chestName}": cancel event if clicked slot is 9: if {aalert::%player%::chat} is not set: set slot 9 of player's current inventory to {@chatOption} set slot 16 of player's current inventory to {@possibleSendMessButton} set slot 0 of player's current inventory to {@positiveSeparator} set slot 18 of player's current inventory to {@positiveSeparator} possibleSendMessageFunction(player) set {aalert::%player%::chat} to true stop else: set slot 9 of player's current inventory to {@notChatOption} set slot 0 of player's current inventory to {@negativeSeparator} set slot 18 of player's current inventory to {@negativeSeparator} if {aalert::%player%::title} and {aalert::%player%::actionbar} is not set: set slot 16 of player's current inventory to {@cantSendMessButton} cantSendMessageFunction(player) delete {aalert::%player%::chat} stop if clicked slot is 11: if {aalert::%player%::title} is not set: set slot 11 of player's current inventory to {@titleOption} set slot 16 of player's current inventory to {@possibleSendMessButton} set slot 2 of player's current inventory to {@positiveSeparator} set slot 20 of player's current inventory to {@positiveSeparator} possibleSendMessageFunction(player) set {aalert::%player%::title} to true stop else: set slot 11 of player's current inventory to {@notTitleOption} set slot 2 of player's current inventory to {@negativeSeparator} set slot 20 of player's current inventory to {@negativeSeparator} if {aalert::%player%::chat} and {aalert::%player%::actionbar} is not set: set slot 16 of player's current inventory to {@cantSendMessButton} cantSendMessageFunction(player) delete {aalert::%player%::title} stop if clicked slot is 13: if {aalert::%player%::actionbar} is not set: set slot 13 of player's current inventory to {@actionbarOption} set slot 16 of player's current inventory to {@possibleSendMessButton} set slot 4 of player's current inventory to {@positiveSeparator} set slot 22 of player's current inventory to {@positiveSeparator} possibleSendMessageFunction(player) set {aalert::%player%::actionbar} to true stop else: set slot 13 of player's current inventory to {@notActionbarOption} set slot 4 of player's current inventory to {@negativeSeparator} set slot 22 of player's current inventory to {@negativeSeparator} if {aalert::%player%::chat} and {aalert::%player%::title} is not set: set slot 16 of player's current inventory to {@cantSendMessButton} cantSendMessageFunction(player) delete {aalert::%player%::actionbar} stop if clicked slot is 16: if clicked item is {@possibleSendMessButton}: close player's inventory if {aalert::%player%::chat} is true: delete {aalert::%player%::chat} broadcast "&4&lALERT &8» &f%coloured {aalert::%player%::message}%" if {aalert::%player%::title} is true: delete {aalert::%player%::title} loop all players: send loop-player title "&4&lALERT" with subtitle "&f%coloured {aalert::%player%::message}%" for 4 seconds if {aalert::%player%::actionbar} is true: delete {aalert::%player%::actionbar} loop all players: show action bar from "&4&lALERT &8» &f%{aalert::%player%::message}%" to all players else: cancel event function cantSendMessageFunction(p: player): set slot 6 of {_p}'s current inventory to {@negativeSeparator} set slot 7 of {_p}'s current inventory to {@negativeSeparator} set slot 8 of {_p}'s current inventory to {@negativeSeparator} set slot 15 of {_p}'s current inventory to {@negativeSeparator} set slot 17 of {_p}'s current inventory to {@negativeSeparator} set slot 24 of {_p}'s current inventory to {@negativeSeparator} set slot 25 of {_p}'s current inventory to {@negativeSeparator} set slot 26 of {_p}'s current inventory to {@negativeSeparator} function possibleSendMessageFunction(p: player): set slot 6 of {_p}'s current inventory to {@positiveSeparator} set slot 7 of {_p}'s current inventory to {@positiveSeparator} set slot 8 of {_p}'s current inventory to {@positiveSeparator} set slot 15 of {_p}'s current inventory to {@positiveSeparator} set slot 17 of {_p}'s current inventory to {@positiveSeparator} set slot 24 of {_p}'s current inventory to {@positiveSeparator} set slot 25 of {_p}'s current inventory to {@positiveSeparator} set slot 26 of {_p}'s current inventory to {@positiveSeparator} # --- END OF FILE --- #