# Sejfy by ProXEQ # Wersja skryptu 1.3 # Wszystkie prawa zastrzeżone! options: version: 1.3 file: plugins/PQSejfy/config.yml # --------------------------------------------------------------------------------------------------------------------- # KOD SKRYPTU (Autor nie odpowiada za to ze przestanie on dzialac kiedy cos tu zmienisz :D) # --------------------------------------------------------------------------------------------------------------------- on load: if yaml value "version" from "{@file}" is not "{@version}": send "[PQSejfy] Loading new Config file" to console set yaml value "version" from "{@file}" to "{@version}" set yaml value "Safe.Name" from "{@file}" to "&9Magiczny Sejf" set yaml value "Safe.Rows" from "{@file}" to 6 set yaml value "Safe.OnFirstJoin" from "{@file}" to true set yaml value "Safe.Lore.Line1" from "{@file}" to "&8• &7Wlasciciel: &9$var" set yaml value "Safe.Lore.Line2" from "{@file}" to "&8• &7ID: &9$var" set yaml value "Safe.GUI" from "{@file}" to "&lSejf ##" set yaml value "Crowbar.Name" from "{@file}" to "&9Lom do sejfu" set yaml value "Crowbar.GUI" from "{@file}" to "&lLom" add "&7Dzieki temu otworzysz sejf innego gracza" to yaml list "Crowbar.Lore" from "{@file}" add "&e&lPPM &7aby uzyc!" to yaml list "Crowbar.Lore" from "{@file}" set yaml value "Messages.NoPermission" from "{@file}" to "&8» &cNie masz do tego uprawnien!" set yaml value "Messages.SafeOpenMessage" from "{@file}" to "&8» &7Otworzyles sejf!" set yaml value "Messages.SafeCloseMessage" from "{@file}" to "&8» &7Zamknoles sejf!" set yaml value "Messages.NotOwned" from "{@file}" to "&8» &cTen sejf nie nalezy do ciebie!" set yaml value "Messages.CrowbarUse" from "{@file}" to "&8» &7Klodka z sejfu zostala zerwana!" set yaml value "Messages.IDDoesNotExists" from "{@file}" to "&8» &cNie ma sejfu o tym ID!" set yaml value "Messages.Reload" from "{@file}" to "&8» &7Sejfy zostaly przeladowane!" send "[PQSejfy] Loading finished!" to console # vars send "[PQSejfy] Author: ProXEQ" to console set {sejf.name} to yaml value "Safe.Name" from "{@file}" set {sejf.lore1} to yaml value "Safe.Lore.Line1" from "{@file}" set {sejf.lore1.n} to {sejf.lore1} replace all "$var" with "" in {sejf.lore1.n} set {sejf.lore2} to yaml value "Safe.Lore.Line2" from "{@file}" set {sejf.lore2.n} to {sejf.lore2} replace all "$var" with "" in {sejf.lore2.n} set {sejf.rows} to yaml value "Safe.Rows" from "{@file}" set {sejf.gui} to yaml value "Safe.GUI" from "{@file}" set {sejf.cb.gui} to yaml value "Crowbar.GUI" from "{@file}" set {sejf.cb.lore::*} to yaml list "Crowbar.Lore" from "{@file}" on unload: delete {sejf.name} delete {sejf.lore1} delete {sejf.lore1.n} delete {sejf.lore2} delete {sejf.lore2.n} delete {sejf.rows} delete {sejf.gui} delete {sejf.cb.gui} delete {sejf.cb.lore::*} function doNothing(): add 1 to {_i7} delete {_i7} function safe_give(p: player): add 1 to {sejf.id} set {_1} to {sejf.lore1} replace all "$var" with "%{_p}%" in {_1} set {_2} to {sejf.lore2} replace all "$var" with "%{sejf.id}%" in {_2} give 1 chest named {sejf.name} with lore "%{_1}%" and "%{_2}%" to {_p}'s inventory stop function safe_clear(id: integer): if {sejf::%{_id}%::*} is set: clear {sejf::%{_id}%::*} stop function safe_open(p: player, id: integer): open chest with {sejf.rows} rows named "%{sejf.gui}%%{_id}%" to {_p} loop {sejf.rows}*9 times: set slot "%loop-number - 1%" parsed as an integer of current inventory of {_p} to {sejf::%{_id}%::%loop-number%} send "%yaml value ""Messages.SafeOpenMessage"" from ""{@file}""%" to {_p} stop function safe_save(p: player,id: integer): delete {sejf::%{_id}%::*} send "%yaml value ""Messages.SafeCloseMessage"" from ""{@file}""%" to {_p} loop 6*9 times: set {sejf::%{_id}%::%loop-number%} to slot "%loop-number - 1%" parsed as an integer of current inventory of {_p} stop function crowbar_give(p: player, i: integer=1): set {_name} to yaml value "Crowbar.Name" from "{@file}" set {_lore::*} to yaml list "Crowbar.Lore" from "{@file}" give {_i} of glowing stick named "%{_name}%" with lore {_lore::*} to {_p}'s inventory stop function crowbar_gui(p: player): set {_gui} to yaml value "Crowbar.GUI" from "{@file}" open chest with 1 rows named "%{_gui}%" to {_p} set slot 0 and 1 and 2 and 3 and 5 and 6 and 7 and 8 of {_p}'s current inventory to red stained glass pane named " " set slot 4 of {_p}'s current inventory to air stop variables: {sejf.id} = 0 on first join: if yaml value "Safe.OnFirstJoin" from "{@file}" is true: add 1 to {sejf.id} give 1 chest named {sejf.name} with lore "&8• &7Wlasciciel: &3%player%" and "&8• &7ID: &3%{sejf.id}%" to player's inventory stop on rightclick: if player's tool is chest: #if lore of player's tool contains "&8• &7Wlasciciel: &3%player%": set {_l::*} to lore of player's tool set {_id} to "%{_l::2}%" replace all "%{sejf.lore2.n}%" with "" in {_id} set {_x} to "%{sejf.lore1.n}%%player%" if {_l::1} is "%{_x}%": cancel event safe_open(player, ({_id} parsed as integer)) stop if {_l::1} contains {sejf.lore1.n}: cancel event send "%yaml value ""Messages.NotOwned"" from ""{@file}""%" stop if player's tool is stick: set {_l::*} to lore of player's tool if {_l::1} is {sejf.cb.lore::1}: crowbar_gui(player) stop on inventory click: if inventory name of player's current inventory is "%{sejf.cb.gui}%": set {_l::*} to uncolored lore of event-item if event-slot is not 59: cancel event if event-slot is 4: if clicked inventory is inventory of player: cancel event stop set {_x} to cursor slot of player set {_l::*} to lore of {_x} set {_e} to {sejf.lore1.n} if {_l::1} contains {sejf.lore1.n}: doNothing() else: send "&cNIE" cancel event stop set the 1st line of {_x}'s lore to "%{sejf.lore1.n}%%player%" give 1 of {_x} to player set cursor slot of player to air close player's inventory set {_lore::*} to yaml list "Crowbar.Lore" from "{@file}" remove 1 of player's tool from player's inventory send "%yaml value ""Messages.CrowbarUse"" from file ""{@file}""%" stop if {_l::1} contains "%uncolored {sejf.lore1.n}%": set cursor slot of player to event-item set event-slot to air if inventory name of player's current inventory contains "%{sejf.gui}%": if event-item is chest: set {_l::*} to uncolored lore of event-item if {_l::1} contains "%uncolored {sejf.lore1.n}%": cancel event on inventory close: if inventory name of player's current inventory is "%{sejf.cb.gui}%": if slot 4 of player's current inventory is not empty: set {_x} to slot 4 of player's current inventory if {_x} is chest: give 1 of {_x} to player if inventory name of player's current inventory contains "%{sejf.gui}%": set {_id} to "%inventory name of player's current inventory%" set {_x} to "%uncolored {sejf.gui}%" replace all "%{_x}%" with "" in {_id} set {_idx} to "%uncolored {_id}%" parsed as integer safe_save(player,{_idx}) command /asejf [] [] []: description: Komenda odpowiadajaca za Sejfy trigger: if arg 1 is not set: if sender has permission "sejf.help": send "&8&m--------------------------------------" send " &8• &7/asejf give &eDaje sejf graczowi" send " &8• &7/asejf givekey &eDaje klucze graczowi" send " &8• &7/asejf open &eOtwiera sejf o danym ID" send " &8• &7/asejf clear &eCzysci dany sejf" send " &8• &7/asejf reload &ePrzeladowywuje skrypt" send "&8&m--------------------------------------" stop send "%yaml value ""Messages.NoPermission"" from ""{@file}""%" stop if arg 1 is "give": if sender has permission "sejf.give": if (arg 2 parsed as offlineplayer) is not set: send "&4&l! &cPoprawne uzycie: &7/asejf give " stop safe_give((arg 2 parsed as offlineplayer)) stop send "%yaml value ""Messages.NoPermission"" from ""{@file}""%" stop if arg 1 is "givekey": if sender has permission "sejf.givekey": if (arg 2 parsed as offlineplayer) or arg 3 is not set: send "&4&l! &cPoprawne uzycie: &7/asejf givekey " stop crowbar_give((arg 2 parsed as offlineplayer),arg 3) stop send "%yaml value ""Messages.NoPermission"" from ""{@file}""%" stop if arg 1 is "reload": if sender has permission "sejf.reload": reload script "%script name%" send "%yaml value ""Messages.Reload"" from ""{@file}""%" stop send "%yaml value ""Messages.NoPermission"" from ""{@file}""%" stop if arg 1 is "open": if sender has permission "sejf.open": set {_id} to arg 2 parsed as integer if {_id} is not set: send "&8» &cPoprawne uzycie: &f/asejf open " stop if {sejf::%{_id}%::*} is not set: send "%yaml value ""Messages.IDDoesNotExists"" from ""{@file}""%" stop safe_open(player, {_id}) stop send "%yaml value ""Messages.NoPermission"" from ""{@file}""%" stop if arg 1 is "clear": if sender has permission "sejf.clear": if arg 2 is not set: send "&4&l! &cPoprawne uzycie: &7/asejf clear " stop set {_id} to arg 2 if {sejf::%{_id}%::*} is not set: send "&8» &cNie ma tekiego sejfu, lub jest pusty!" stop safe_clear({_id}) send "&8» &7Wyczyszczono sejf &c&l##%{_id}%" stop send "%yaml value ""Messages.NoPermission"" from ""{@file}""%" stop