#===================# # zJail # #===================# #Author: Zaaxel #Version: 1.0 #Description: Skrypt na cele dla graczy #=================================================================================================# options: tag: &8[&ezJail&8] world: world variables: {zJail::liczbaCel} = 0 #=================================================================================================# command /zJail:jailtool: executable by: player aliases: jt, jailtool trigger: if player doesn't have permissions "zJail.jailTool": send "&4Nie masz uprawnien!" else: if player can hold 1 stick named "&6&oJailTool" with lore "&7Narzedzie do tworzenia cel": give player 1 stick named "&6&oJailTool" with lore "&7Narzedzie do tworzenia cel" else: send "{@tag} &cNie masz miejsca w ekwipunku" #=================================================================================================# command /zJail:jail [] []: aliases: jail, zJail trigger: if sender doesn't have permissions "zJail.jail": send "&4Nie masz uprawnien!" else: if arg-1 is not set: send "" send "&e/jail create &7- tworzenie celi" send "&e/jail delete &7- usuwanie celi" send "&e/jail list &7- lista cel" send "&e/jail &7- wrzucenie gracza do celi" send "&e/unjail &7- wypuszczenie gracza" send "&e/jail mute &7- zmutowanie gracza w celi" send "&e/jail unmute &7- odmutowanie gracza w celi" send "&e/jail setfree &7- ustawienie spawnu wypuszczonych graczy" # Tworzenie celi if arg-1 is "create": if arg-2 is not set: send "{@tag} &cWprowadz nazwe celi" else: if {zJail::liczbaCel} is 0: if {zJail::P1::%player%} is not set: send "{@tag} &cZaznacz P1 klikajac LPM trzymajac &6&oJailTool" else: if {zJail::P2::%player%} is not set: send "{@tag} &cZaznacz P2 klikajac PPM trzymajac &6&oJailTool" else: execute player command "//pos1 %{zJail::P1::%player%}%" execute player command "//pos2 %{zJail::P2::%player%}%" wait 1 tick execute player command "/rg define %arg-2% %player%" add 1 to {zJail::liczbaCel} add arg-2 to {zJail::Cela::*} set {zJail::SpawnOf::%arg-2%} to location of player send "{@tag} &7Cela &a%arg-2% &7zostala stworzona" else: loop {zJail::Cela::*}: if loop-value is arg-2: send "{@tag} &cIstnieje cela o takiej nazwie" stop else: exit loop if {zJail::P1::%player%} is not set: send "{@tag} &cZaznacz P1 klikajac LPM trzymajac &6&oJailTool" else: if {zJail::P2::%player%} is not set: send "{@tag} &cZaznacz P2 klikajac PPM trzymajac &6&oJailTool" else: execute player command "//pos1 %{zJail::P1::%player%}%" execute player command "//pos2 %{zJail::P2::%player%}%" wait 1 tick execute player command "/rg define %arg-2% %player%" add 1 to {zJail::liczbaCel} add arg-2 to {zJail::Cela::*} set {zJail::SpawnOf::%arg-2%} to location of player send "{@tag} &7Cela &a%arg-2% &7zostala stworzona" # Usuwane celi if arg-1 is "delete": if arg-2 is not set: send "{@tag} &cWprowadz nazwe celi" else: if {zJail::liczbaCel} is 0: send "{@tag} &cNie ma zadnych cel na swiecie" else: loop {zJail::Cela::*}: if loop-value is not arg-2: send "{@tag} &cNie ma takiej celi na swiecie" else: remove arg-2 from {zJail::Cela::*} remove 1 from {zJail::liczbaCel} delete {zJail::SpawnOf::%arg-2%} execute player command "/rg remove %arg-2%" send "{@tag} &7Cela &a%arg-2% &7zostala usunieta" exit loop # Lista cel if arg-1 is "list": if {zJail::liczbaCel} is 0: send "{@tag} &cNie ma zadnych cel na liscie" else: send "&6======> &7LISTA" set {_} to 1 loop (size of {zJail::Cela::*}) times: loop {zJail::Cela::*}: add loop-value-2 to {CheckList::*} send "&e%{_}%. &a%loop-value-2 %" remove loop-value-2 from {zJail::Cela::*} add 1 to {_} wait 1 tick loop (size of {CheckList::*}) times: loop {CheckList::*}: add loop-value-2 to {zJail::Cela::*} remove loop-value-2 from {CheckList::*} delete {CheckList::*} # Wsadzanie do celi gracza if arg-1 is not "create" or "delete" or "list" or "mute" or "unmute" or "setfree": set {_p} to arg-1 parsed as player if {_p} is online: if {zJail::inJail::%{_p}%} is set: send "{@tag} &cTen gracz jest juz w celi" else: if arg-2 is not set: if {zJail::liczbaCel} is 0: send "{@tag} &cNie ma zadnych cel" else: send "{@tag} &cWprowadz nazwe celi sposrod podanych:" set {_} to 1 loop (size of {zJail::Cela::*}) times: loop {zJail::Cela::*}: add loop-value-2 to {CheckList::*} send "&e%{_}%. &a%loop-value-2 %" remove loop-value-2 from {zJail::Cela::*} add 1 to {_} wait 1 tick loop (size of {CheckList::*}) times: loop {CheckList::*}: add loop-value-2 to {zJail::Cela::*} remove loop-value-2 from {CheckList::*} delete {CheckList::*} else: if {zJail::liczbaCel} is 0: send "{@tag} &cNie ma zadnych cel" else: if {zJail::Cela::*} contains arg-2: set {zJail::inJail::%{_p}%} to arg-2 teleport {_p} to {zJail::SpawnOf::%arg-2%} send "{@tag} &4Zostales wtracony do celi przez gracza: &c%sender%" to {_p} send "{@tag} &cWrzuciles gracza &a%{_p}% &cdo celi &a%arg-2%" # Mutowanie if arg-1 is "mute": if arg-2 is not set: send "{@tag} &cMusisz wprowadzic nick gracza" else: if {zJail::inJail::%arg-2%} is not set: send "{@tag} &cTen gracz nie jest w celi" else: if {zJail::Muted::%arg-2%} is set: send "{@tag} &cTen gracz jest juz zmutowany" else: set {zJail::Muted::%arg-2%} to true send "{@tag} &7Zmutowales gracza &a%arg-2%" send "{@tag} &7Zostales zmutowany przez gracza &c%sender%" to arg-2 parsed as player # Odmutowanie if arg-1 is "unmute": if arg-2 is not set: send "{@tag} &cMusisz wprowadzic nick gracza" else: if {zJail::inJail::%arg-2%} is not set: send "{@tag} &cTen gracz nie jest w celi" else: if {zJail::Muted::%arg-2%} is not set: send "{@tag} &cTen gracz nie jest zmutowany" else: delete {zJail::Muted::%arg-2%} send "{@tag} &7Odmutowales gracza &a%arg-2%" send "{@tag} &7Zostales odmutowany przez gracza &c%sender%" to arg-2 parsed as player # Ustawienia spawnu po wyjsciu if arg-1 is "setfree": set {zJail::Free} to location of player send "{@tag} &aUstawiles spawn po wyjsciu z celi" #=================================================================================================# command /zJail:unjail []: aliases: unjail, zunjail trigger: if sender doesn't have permissions "zJail.unjail": send "&4Nie masz uprawnien!" else: if offlineplayer-arg is set: if {zJail::inJail::%offlineplayer-arg%} is set: if {zJail::Muted::%offlineplayer-arg%} is set: delete {zJail::Muted::%offlineplayer-arg%} delete {zJail::inJail::%offlineplayer-arg%} send "{@tag} &cUwolniles gracza &a%offlineplayer-arg%" send "{@tag} &aZostales uwolniony z celi!" to offlineplayer-arg if {zJail::Free} is set: teleport offlineplayer-arg to {zJail::Free} else: teleport offlineplayer-arg to spawn else: send "{@tag} &cTen gracz nie przebywa w wiezieniu" else: send "{@tag} &cMusisz wprowadzic nazwe gracza" #=================================================================================================# on chat: if {zJail::Muted::%player%} is set: cancel event on command: if {zJail::inJail::%player%} is set: cancel event #=================================================================================================# on region leave: set {_r} to "%region at player%" replace all " in world {@world}" with "" in {_r} if {zJail::Cela::*} contains {_r}: if {zJail::inJail::%player%} is set: cancel event push player backwards at speed 0.3 teleport player to {zJail::SpawnOf::%{zJail::inJail::%player%}%} #=================================================================================================# on leftclick: if player's tool is stick named "&6&oJailTool" with lore "&7Narzedzie do tworzenia cel": if {zJail::P1::%player%} is not set: if event-block is not set: stop else: set {zJail::P1::%player%} to "%rounded x location of event-block%,%rounded y location of event-block%,%rounded z location of event-block%" send "{@tag} &7Ustawiono punkt 1 do lokalizacji: &a%{zJail::P1::%player%}%" else: if event-block is not set: stop else: set {zJail::P1::%player%} to "%rounded x location of event-block%,%rounded y location of event-block%,%rounded z location of event-block%" send "{@tag} &7Zaktualizowano punkt 1 do lokalizacji: &a%{zJail::P1::%player%}%" on rightclick: if player's tool is stick named "&6&oJailTool" with lore "&7Narzedzie do tworzenia cel": if {zJail::P2::%player%} is not set: if event-block is not set: stop else: set {zJail::P2::%player%} to "%rounded x location of event-block%,%rounded y location of event-block%,%rounded z location of event-block%" send "{@tag} &7Ustawiono punkt 2 do lokalizacji: &a%{zJail::P2::%player%}%" else: if event-block is not set: stop else: set {zJail::P2::%player%} to "%rounded x location of event-block%,%rounded y location of event-block%,%rounded z location of event-block%" send "{@tag} &7Zaktualizowano punkt 2 do lokalizacji: &a%{zJail::P2::%player%}%"