# ##################### # SEKCJA KONFIGURACYJNA # ##################### options: # NAZWA GUI AUKCJI nameGui: &cAUKCJE # vault / zmienna, # vault wymaga pluginu vault oraz pluginu do ekonomii, np. essentails # zmienna nie wymaga żadnego pluginu ekonomia: "zmienna" # jeśli wybrałeś zmienna to: # pieniądze na start: startMoney: 100 # wpisz nazwę swojej zmiennej, domyślnie jest to balance ekonomiaZmienna: balance # symbol pieniędzy: moneySymbol: $ # PERMISJE: # - wymagać permisję do użycia komendy /aukcje? ("true" - wymaga, "false" - nie wymaga) requirePermission: false # - jeśli powyżej true, to jaka permisja? cmdPermission: aukcje.gracz # - permisja dla admina, do czyszczenia aukcji (debug) adminPermission: aukcje.* # WIADOMOSCI: # - wiadomość o braku uprawnienia noPermission: &cNie masz uprawnienia do używania tej komendy! # - brak aukcji: noAuctions: &cAktualnie nie ma zadnych aukcji! # - gracz chce wystawic powietrze: itemIsAir: &cNie mozesz wystawic niczego! # - gracz podal niepoprawna cene: invalidPrice: &cPodaj poprawną cenę! # - wiadomosc, gdy item jest nieaktualny soldItem: &cTen przedmiot jest nieaktualny! # - gracz usunal przedmiot ze sklepu itemRemoved: &cUsunales przedmiot ze sklepu! # - gracz nie ma tyle srodkow noMoney: &cNie masz tyle kasy! # - niepoprawna ilosc przedmiotow invalidAmount: &cPodales niepoprawna ilosc przedmiotow # - gracz nie ma tyle przedmiotow noItems: &cNie masz tyle itemow, by je wystawic! # - gracz podal nie swoją aukcję podczas usuwania otherUserAuction: &cPodana aukcja nie nalezy do Ciebie! # - aukcja została usunięta auctionRemoved: &cAukcja została usunięta. # ################################ # KOD, NIE ZALECAM NIC TU ZMIENIAC # ################################ version: v1.3 function openGui(p:player,page:integer): # page to aktualna strona if size of {aukcje::*} = 0: send "{@noAuctions}" to {_p} if name of {_p}'s current inventory = "{@nameGui}": close {_p}'s inventory stop set {_gui} to chest inventory named "{@nameGui}" with 6 rows set slot (integers between 0 and 44) of {_gui} to air set slot (integers between 45 and 53) of {_gui} to gray stained glass pane named " " set {_lore::1} to {_page}-1 if {_lore::1} > 0: set slot 45 of {_gui} to green stained glass pane named "&7<-- &epoprzednia strona" with lore "%{_lore::1}%" set slot 49 of {_gui} to yellow stained glass pane named "&eaktualna strona" with lore "%{_page}%" set {_lore::2} to {_page}+1 if (size of {aukcje::*}) > {_page}*45: set slot 53 of {_gui} to green stained glass pane named "&enastepna strona &7-->" with lore "%{_lore::2}%" # if {_page} is 1: set {_sloty} to 0 set {_loop} to 0 set {_itemy} to ({_page}-1)*45 loop {aukcje::*}: add 1 to {_loop} if {_loop} > {_itemy}: if {aukcje::%loop-index%::status} is true: {_sloty} < 45 set slot {_sloty} of {_gui} to {aukcje::%loop-index%::item} with lore "" and "&7Wystawiajacy: &e%{aukcje::%loop-index%::player}%" and "&7Cena: &e%{aukcje::%loop-index%::cost}%{@moneySymbol}" and "&7ID: &e%loop-index%" and "&7Status: &aaktywne" add 1 to {_sloty} open {_gui} to {_p} function usun(id:integer): delete {aukcje::%{_id}%::*} delete {aukcje::%{_id}%} function zakup(p:player,id:integer): set {_it} to {aukcje::%{_id}%::item} # naprawa lore delete lore of {_it} give {_it} with lore {aukcje::%{_id}%::itemlore::*} to {_p} if {@ekonomia} = "vault": remove {aukcje::%{_id}%::cost} from {_p}'s balance add {aukcje::%{_id}%::cost} to {aukcje::%{_id}%::player}'s balance else: remove {aukcje::%{_id}%::cost} from {{@ekonomiaZmienna}::%{_p}%} add {aukcje::%{_id}%::cost} to {{@ekonomiaZmienna}::%{aukcje::%{_id}%::player}%} send formatted "&aGracz &e%{_p}% &akupil przedmiot &e##%{_id}% &aod &e%{aukcje::%{_id}%::player}%!" to all players usun({_id}) on load: wait 1 tick send "Korzystasz ze Skryptu gAukcje {@version}" to console if {@ekonomia} = "vault": send "&cKorzystasz z ekonomii Vault, jeśli podczas ładowania skryptu wyskakuje błąd:" to console send "&c""can't understand this condition: player's balance""" to console send "&cUpewnij się, że posiadasz plugin Vault oraz inny do zarządzania ekonomią (np. Essentials)" to console else: send "&cKorzystasz z ekonomii w Skript" to console send "&cAby dodać komendę /money odkomentuj ją w skrypcie" to console send "&cZnajduje się ona na końcu kodu" to console send "&cjeśli podczas ładowania skryptu wyskakuje błąd:" to console send "&c""can't understand this condition: player's balance""" to console send "&cmożesz go zignorować, jeśli chcesz go usunąć zakomentuj linijkę z wyrażeniem player's balance" to console on join: {@ekonomia} is not "vault" {{@ekonomiaZmienna}::%player%} is not set set {{@ekonomiaZmienna}::%player%} to {@startMoney} command /aukcja [] [] []: aliases: /aukcje trigger: if {@requirePermission} is true: if player doesn't have permission "{@cmdPermission}" or "{@adminPermission}": send "{@noPermission}" stop if arg-1 = "dodaj" or "add": if (arg-2 parsed as integer) is not integer: send "{@invalidPrice}" stop if player's tool = air: send "{@itemIsAir}" stop if (arg-3 parsed as integer) is not integer: send "{@invalidAmount}" if item amount of player's tool < (arg-3 parsed as integer): send "{@noItems}" stop if (arg-3 parsed as integer) < 1: send "{@noItems}" stop set {_num} to (last element out of all indexes of {aukcje::*}) parsed as integer + 1 set {aukcje::%{_num}%::item} to (arg-3 parsed as integer) of player's held item set {aukcje::%{_num}%::itemlore::*} to lore of player's held item set {aukcje::%{_num}%::player} to player set {aukcje::%{_num}%::cost} to (arg-2 parsed as integer) set {aukcje::%{_num}%::status} to true set {aukcje::%{_num}%} to true send formatted "&aGracz &e%player% &awystawil przedmiot &e##%{_num}%&7 (najedź myszką)!" to all players set player's tool to (item amount of player's tool - (arg-3 parsed as integer)) of player's tool else if arg-1 = "debug": player has permission "{@adminPermission}" loop {aukcje::*}: add loop-index to {_l::*} send "%{_l::*}%" if arg-2 = "reset": clear {aukcje::*} send "&7Wyczyszczono aukcje!" else if arg-1 = "lista": loop {aukcje::*}: if {aukcje::%loop-index%::player} is player: send "&7=-=-=-=-=-=--=-=--=-=-=-=-=" to player send "&7przedmiot: &e%{aukcje::%loop-index%::item}%" to player send "&7cena: &e%{aukcje::%loop-index%::cost}%{@moneySymbol}" to player send "&7id: &e%loop-index%" to player send formatted "&7&eKliknij, aby usunac!" else if arg-1 = "usun" or "remove": if (arg-2 parsed as integer) is not set: send "{@otherUserAuction}" stop if {aukcje::%arg-2%::player} != player: if player doesn't have permission "{@adminPermission}": send "{@otherUserAuction}" stop usun(arg-2 parsed as integer) send "{@auctionRemoved}" else if arg-1 is not set: openGui(player,1) else: send "&7=-=-=-=-=-=-=-=-=-=-=" send "&e/aukcje dodaj &7- dodaje item z łapki, podanie ilości jest opcjonalne" send "&e/aukcje usun &7- usuwa item z danym ID" send "&e/aukcje lista &7- pokazuje wszystkie Twoje aukcje" if player has permission "{@adminPermission}": send "&c/aukcje debug &7- pokazuje wszystkie id aukcji na chacie" send "&c/aukcje debug reset &7- usuwa wszystkie aukcje (UWAGA! Nie oddaje itemów graczom)" send "&7=-=-=-=-=-=-=-=-=-=-=" on inventory click: name of player's current inventory = "{@nameGui}" clicked inventory is not player's inventory cancel event clicked slot is set clicked slot is not air if index of clicked slot is 45 or 49 or 53: set {_line1} to line 1 of lore of clicked slot parsed as integer {_line1} is set openGui(player,{_line1}) stop index of clicked slot is between 0 and 44 set {_lore::*} to lore of clicked slot loop {_lore::*}: if "%loop-value%" contains "&7ID: &e": set {_line} to loop-index set {_lore} to uncoloured {_lore::%{_line}%} replace all "ID: " in {_lore} with "" set {_id} to {_lore} parsed as integer if {aukcje::%{_id}%::status} is not true: send "{@soldItem}" set slot (index of clicked slot) of player's current inventory to air stop if {@ekonomia} = "vault": if player's balance < {aukcje::%{_id}%::cost}: send "{@noMoney}" stop else: if {{@ekonomiaZmienna}::%player%} < {aukcje::%{_id}%::cost}: send "{@noMoney}" stop zakup(player,{_id}) set slot (index of clicked slot) of player's current inventory to air # JEŚLI KORZYSTASZ ZE ZMIENNEJ ZAMIAST VAULT - ODKOMENTUJ PONIŻSZE LINIJKI (usuń # na początku)! #command /money: # aliases: /kasa, /pieniadze, /stankonta, /saldo # możesz dodać własne aliasy # trigger: # send "&cStan konta: &e%{{@ekonomiaZmienna}::%player%}%"