#KOD: #FUNKCJE function UwagiPozytywne(p: player): if {uwagiPOZ::%{_p}%::*} is not set: send "&cNie masz żadnych uwag pozytywnych :c" to {_p} stop set {_gui} to chest inventory with 3 rows named "&aUwagi pozytywne: " loop {uwagiPOZ::%{_p}%::*}: add book named "&cUwaga pozytywna" with lore "" and "&7Treść uwagi: " and "&a%loop-value%" and "" to {_gui} set slot (integers between 18 and 26) of {_gui} to gray stained glass pane named "&7-" set slot 26 of {_gui} to red dye named "&cPowrót " open {_gui} to {_p} function UwagiNegatywne(p: player): if {uwagiNEG::%{_p}%::*} is not set: send "&aNie masz żadnych uwag negatywnych!" to {_p} stop set {_gui} to chest inventory with 3 rows named "&cUwagi negatywne: " loop {uwagiNEG::%{_p}%::*}: add book named "&cUwaga negatywna" with lore "" and "&7Treść uwagi: " and "&a%loop-value%" and "" to {_gui} set slot (integers between 18 and 26) of {_gui} to gray stained glass pane named "&7-" set slot 26 of {_gui} to red dye named "&cPowrót " open {_gui} to {_p} function Ogloszenia(p: player): if {Ogloszenia::*} is not set: send "&cNie ma żadnych ogłoszeń!" to {_p} stop set {_gui} to chest inventory with 3 rows named "&8Ogłoszenia: " loop {Ogloszenia::*}: add painting named "&bOgłoszenie: " with lore "" and "&7Treść: &a%loop-value%" to {_gui} set slot (integers between 18 and 27) of {_gui} to gray stained glass pane named "&7-" set slot 26 of {_gui} to red dye named "&cPowróć " open {_gui} to {_p} function Librus(p: player): set {_gui} to chest inventory with 3 rows named "&8Librus" set slot (integers between 0 and 27) of {_gui} to gray stained glass pane named "&7-" set slot 10 of {_gui} to bookshelf named "&cUwagi&7/&aPochwały" set slot 13 of {_gui} to enchanted book named "&6Oceny" set slot 16 of {_gui} to map named "&bOgłoszenia" open {_gui} to {_p} function UwagiMenu(p: player): set {_gui} to chest inventory with 1 rows named "&3Uwagi" set slot (integers between 0 and 9) of {_gui} to gray stained glass pane named "&7-" set slot 2 of {_gui} to written book named "&cUwagi negatywne" set slot 4 of {_gui} to red dye named "&cPowrót" set slot 6 of {_gui} to written book named "&aUwagi pozytywne" open {_gui} to {_p} function Oceny(p: player): set {_gui} to chest inventory with 2 rows named "&6Oceny" set slot 0 of {_gui} to knowledge book named "&2Matematyka" set slot 1 of {_gui} to knowledge book named "&3Polski" set slot 2 of {_gui} to knowledge book named "&4Biologia" set slot 3 of {_gui} to knowledge book named "&6Angielski" set slot 4 of {_gui} to knowledge book named "&5Historia" set slot 5 of {_gui} to knowledge book named "&9Geografia" set slot 6 of {_gui} to knowledge book named "&bWf" set slot 7 of {_gui} to knowledge book named "&cFizyka" set slot 8 of {_gui} to knowledge book named "&aChemia" set slot (integers between 9 and 17) of {_gui} to gray stained glass pane named "&7-" loop {WszystkieOceny::%{_p}%::*}: add "%loop-value%" parsed as number to {_WszystkieLiczby} set slot 16 of {_gui} to clock named "&7Średnia ze wszystkich przedmiotów: &a%{_WszystkieLiczby} / amount of {WszystkieOceny::%{_p}%::*}%" set slot 17 of {_gui} to red dye named "&cPowrót " open {_gui} to {_p} function OcenyCheck(p: player, slot: text): set {_gui} to chest inventory with 3 rows named "&8Przedmiot: &9%{_slot}%" if {oceny::%{_slot}%::%{_p}%::*} is not set: send "&7Nie masz żadnej oceny z przedmiotu: &a%{_slot}%!" to {_p} stop set {_Sortowanie::*} to sorted {oceny::%{_slot}%::%{_p}%::*} set {_Odwracanie::*} to reversed {_Sortowanie::*} loop {_Odwracanie::*}: add book named "&aOcena: &6%loop-value%" with lore "" and "&7To jest ocena ktrórą" and "&7dostałeś z przedmiotu: &a%{_slot}%!" and "" to {_gui} add "%loop-value%" parsed as number to {_WszystkieLiczby} set slot 26 of {_gui} to red dye named "&cPowrót" open {_gui} to {_p} set slot 25 of {_gui} to paper named "&7Średnia ocen z tego przedmiotu: &a%{_WszystkieLiczby} / amount of {_Odwracanie::*}%" open {_gui} to {_p} #INVENTORY CLICK on inventory click: if name of event-inventory is "&8Librus": cancel event if clicked slot is 10: UwagiMenu(player) if clicked slot is 13: Oceny(player) if clicked slot is 16: Ogloszenia(player) if name of event-inventory is "&3Uwagi": cancel event if clicked slot is 2: UwagiNegatywne(player) if clicked slot is 4: Librus(player) if clicked slot is 6: UwagiPozytywne(player) if name of event-inventory is "&6Oceny": cancel event if clicked slot is 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8: set {_slot} to uncolored name of clicked slot wait 1 ticks OcenyCheck(player, {_slot}) else if clicked slot is 17: Librus(player) if name of event-inventory contains "&8Przedmiot: ": cancel event if clicked slot is 26: Oceny(player) if name of event-inventory is "&aUwagi pozytywne: ": cancel event if clicked slot is 26: UwagiMenu(player) if name of event-inventory is "&cUwagi negatywne: ": cancel event if clicked slot is 26: UwagiMenu(player) if name of event-inventory is "&8Ogłoszenia: ": cancel event if clicked slot is 26: Librus(player) #KOMENDY command /librus: trigger: Librus(player) command /uwaga [] [] [] []: permission: nauczyciel.exe permission message: &cNie możesz wstawiać uwag ponieważ nie jesteś nauczycielem! trigger: if arg 1 is not set: send "&cPoprawne użycie: /uwaga " stop else if arg 1 is not "dodaj" or "zresetuj": send "&cPoprawne użycie: /uwaga " stop if arg 1 is "dodaj": if arg 2 is not set: send "&cPoprawne użycie: /uwage dodaj " stop if arg 2 is "pozytywna" or "negatywna": if arg 2 is not set: send "&cPoprawne użycie: /uwaga dodaj " stop else if arg 3 is not set: send "&cPoprawne użycie: /uwaga dodaj %arg 2% " stop else if arg 4 is not set: send "&cPoprawne użycie: /uwaga dodaj %arg 2% %arg 3% " stop if arg 2 is "pozytywna": add arg 4 to {uwagiPOZ::%player%::*} send "&7Pomyślnie dodano uwagę pozytywną graczowi: &a%arg 3%" send "&7o treści: &a%arg 4%" if arg 2 is "negatywna": add arg 4 to {uwagiNEG::%player%::*} send "&7Pomyślnie dodano uwagę negatywną graczowi: &a%arg 3%" send "&7o treści: &a%arg 4%" else: send "&cPoprawne użycie: /uwage dodaj " if arg 1 is "zresetuj": if arg 2 is not set: send "&cPoprawne użycie: /uwaga zresetuj " stop if arg 2 is "pozytywna" or "negatywna": if arg 3 is not set: send "&cPoprawne użycie: /uwaga zresetuj " stop if arg 4 is set: send "&cPoprawne użycie: /uwaga zresetuj " stop if arg 2 is "pozytywna": clear {uwagiPOZ::%arg 3%::*} send "&7Pomyślnie zresetowano uwagi &apozytywne &7graczowi &a%arg 3%" if arg 2 is "negatywna": clear {uwagiNEG::%arg 3%::*} send "&7Pomyślnie zresetowano uwagi &anegatywne &7graczowi &a%arg 3%" else: send "&cPoprawne użycie: /uwage zresetuj " command /ocena [] [] [] []: permission: nauczyciel.exe permission message: &cNie możesz wstawiać uwag ponieważ nie jesteś nauczycielem! trigger: if arg 1 is not set: send "&cPoprawne użycie: /ocena " stop if arg 1 is "dodaj" or "zresetuj": if arg 1 is "dodaj": if arg 2 is not set: send "&cPoprawne użycie: /ocena dodaj " stop else if arg 4 is not "1" or "2" or "3" or "4" or "5" or "6": send "&cPoprawne użycie: /ocena dodaj " else if arg 4 is not set: send "&cPoprawne użycie: /ocena dodaj " else if arg 2 is "matematyka" or "chemia" or "fizyka" or "biologia" or "historia" or "polski" or "angielski" or "geografia" or "wf": add arg 4 to {oceny::%arg 2%::%player%::*} add arg 4 to {WszystkieOceny::%player%::*} send "&7Pomyślnie dodano ocene &a%arg 4% &7 do przedmiotu: &a%arg 2%&7 dla gracza: &a%arg 3%" else: send "&cNie możesz dodać oceny do przedmiotu którego nie ma!" if arg 1 is "zresetuj": if arg 2 is "matematyka" or "chemia" or "fizyka" or "biologia" or "historia" or "polski" or "angielski" or "geografia" or "wf": if arg 3 is set: if arg 4 is set: send "&cPoprawne użycie: /zresetujocene " stop clear {oceny::%arg 2%::%arg 3%::*} send "&7Pomyślnie zresetowano oceny z przedmiotu: &a%arg 2%!" else: send "&cPoprawne użycie: /ocena zresetuj " else: send "&cPoprawne użycie: /ocena zresetuj " else: send "&cPoprawne użycie: /ocena " command /ogłoszenie [] []: permission: nauczyciel.exe permission message: &cNie możesz wstawiać uwag ponieważ nie jesteś nauczycielem! trigger: if arg 1 is not set: send "&cPoprawne użycie: /ogłoszenie " stop if arg 1 is "dodaj" or "zresetuj": if arg 1 is "dodaj": if arg 2 is set: add arg 2 to {Ogloszenia::*} send "&7Poprawnie dodano ogłoszenie " send "&7o treści: &a%arg 2%" else: send "&cPoprawne użycie: /ogłoszenie dodaj " if arg 1 is "zresetuj": if arg 2 is set: send "&cPoprawne użycie: /ogloszenie zresetuj" stop clear {Ogloszenia::*} send "&aPomyślnie zresetowano ogloszenia!" else: send "&cPoprawne użycie: /ogłoszenie " #TABOWANIE on tab complete of "/ocena": set tab completions for position 1 to "dodaj" and "zresetuj" set tab completions for position 2 to "polski", "matematyka", "angielski", "biologia", "geografia", "historia", "wf", "chemia" and "fizyka" on tab complete of "/uwaga": set tab completions for position 1 to "dodaj" and "zresetuj" set tab completions for position 2 to "pozytywna" and "negatywna" on tab complete of "/ogłoszenie": set tab completions for position 1 to "dodaj" and "zresetuj" #KONIEC KODU