# Funkcja do uzyskiwania stanu reputacji on join: if {reputacja::%uuid of player%} is not set: set {reputacja::%uuid of player%} to 0 function get_reputacja(p: player) :: text: set {_uuid} to uuid of {_p} set {_reputacja} to {reputacja::%{_uuid}%} # Debugowanie send "&eDebug: Odczytana reputacja: %{_reputacja}%" to {_p} if {_reputacja} >= 10: return "&aDobra" if {_reputacja} <= -10: return "&cZla" return "&eNormalna" function zmien_reputacje(p: player, ilosc: number, powod: text): set {_uuid} to uuid of {_p} if size of {ostatnia_reputacja::%{_uuid}%::*} is larger than or equal to 3: set {ostatnia_reputacja::%{_uuid}%::3} to {ostatnia_reputacja::%{_uuid}%::2} set {ostatnia_reputacja::%{_uuid}%::2} to {ostatnia_reputacja::%{_uuid}%::1} set {ostatnia_reputacja::%{_uuid}%::1} to {_powod} else: add {_powod} to {ostatnia_reputacja::%{_uuid}%::*} add {_ilosc} to {reputacja::%{_uuid}%} on inventory click: if name of event-inventory contains "&8➥ &eOcen gracza": cancel event set {_clicked_item} to clicked item set {_attacker_name} to uncoloured name of event-inventory replace all "➥ Ocen gracza " with "" in {_attacker_name} set {_attacker_name} to {_attacker_name} parsed as player broadcast "%{_attacker_name}%" set {zgloszenie::%uuid of event-player%} to {_attacker_name} if {_clicked_item} is green wool: # Otworz nowe GUI z powodami pozytywnej reakcji set {_gui} to chest inventory with 3 rows named "&8➥ &eWybierz powod" set slot 11 of {_gui} to green stained glass pane named "&aDobrze sie gralo" set slot 13 of {_gui} to blue stained glass pane named "&bDobrze sie dogadujemy" set slot 15 of {_gui} to yellow stained glass pane named "&eInny powod" open {_gui} to event-player stop if {_clicked_item} is red wool: # Otworz GUI do zgloszenia set {_gui} to chest inventory with 3 rows named "&8➥ &ePowod Zgloszenia" set slot 10 of {_gui} to glass pane named "&cCzity" set slot 12 of {_gui} to glass pane named "&cDziwne Zabojstwo" set slot 14 of {_gui} to glass pane named "&cInne" open {_gui} to event-player stop clear {zgloszenie::%uuid of event-player%} #zabezpieczenie. stop # Obsluguje wybor powodu zgloszenia if name of event-inventory contains "&8➥ &ePowod Zgloszenia": cancel event set {_clicked_item} to clicked item set {_zgloszony} to {zgloszenie::%uuid of event-player%} #set {_attacker_name} to {_attacker_name} parsed as player #To nie moze zadzialac bo nie ma w nazwie gracza atakujacego. if {_clicked_item} is glass pane named "&cCzity": send "&aZgloszenie: Czity zostalo zapisane." to event-player zmien_reputacje({_zgloszony}, -1, "&cCzity") broadcast "Dodano dp %{_zgloszony}%" close event-player's inventory stop if {_clicked_item} is glass pane named "&cDziwne Zabojstwo": send "&aZgloszenie: Dziwne zabojstwo zostalo zapisane." to event-player zmien_reputacje({_zgloszony}, -1, "&cDziwne Zabojstwo") close event-player's inventory stop if {_clicked_item} is glass pane named "&cInne": send "&azgloszenie: Inne zgloszenie zostalo zapisane." to event-player zmien_reputacje({_zgloszony}, -1, "&cInne") close event-player's inventory stop stop # Funkcja do uzyskiwania graczy z najlepsza reputacja if name of event-inventory contains "&8➥ &eWybierz powod": cancel event set {_clicked_item} to clicked item set {_zgloszony} to {zgloszenie::%uuid of event-player%} #{_zgloszony} must be player if {_clicked_item} is green stained glass pane: #add 1 to {reputacja::%{_uuid}%} zmien_reputacje({_zgloszony}, 1, "&aDobrze sie gralo") send "&aZwiekszyleś reputacje gracza &e%{_zgloszony}%&a o 1." to event-player send "&aTwoja reputacja wzrosla o 1 dzieki graczowi &e%event-player%." to {_zgloszony} close event-player's inventory stop if {_clicked_item} is blue stained glass pane: #add 1 to {reputacja::%{_uuid}%} zmien_reputacje({_zgloszony}, 1, "&bDobrze sie dogadujemy") send "&aZwiekszyleś reputacje gracza &e%{_zgloszony}%&a o 1." to event-player send "&aTwoja reputacja wzrosla o 1 dzieki graczowi &e%event-player%." to {_zgloszony} close event-player's inventory stop if {_clicked_item} is yellow stained glass pane: zmien_reputacje({_zgloszony}, 1, "&eInny powod") #add 1 to {reputacja::%{_uuid}%} send "&aZwiekszyleś reputacje gracza &e%{_zgloszony}%&a o 1." to event-player send "&aTwoja reputacja wzrosla o 1 dzieki graczowi &e%event-player%." to {_zgloszony} close event-player's inventory stop stop if name of event-inventory is "&8➥ &eTop Graczy Reputacji": cancel event stop # Komenda do otwierania GUI z topka command /topreputacje: trigger: set {_gui} to chest inventory with 6 rows named "&8➥ &eTop Graczy Reputacji" set {_counter} to 0 # Iterowanie po wszystkich graczach na serwerze loop all players: set {_uuid} to uuid of loop-player set {_reputacja} to {reputacja::%{_uuid}%} # Pobierz reputacje gracza set {_typ} to get_reputacja(loop-player) # Typ reputacji set {_ostatnie_zgloszenie::*} to {ostatnia_reputacja::%{_uuid}%::*} # Ostatnie zgloszenie broadcast "%{ostatnia_reputacja::%{_uuid}%::*}%" # Ustaw domyślna wartośc dla ostatniego zgloszenia, jeśli nie jest ustawiona if {_ostatnie_zgloszenie::1} is not set: set {_ostatnie_zgloszenie} to "Brak zgloszen" # Ustaw slot z informacjami o graczu set {_lore::*} to "&7Reputacja: %{_reputacja}%" and "&7Typ: %{_typ}% " and "&7Ostatnie zgloszenie: " add {_ostatnie_zgloszenie::*} to {_lore::*} set slot {_counter} of {_gui} to skull of loop-player named "&e%loop-player%" with lore {_lore::*} add 1 to {_counter} # Wypelnianie pustych miejsc szklem loop integers between 0 and 53: if slot loop-value of {_gui} is air: set slot loop-value of {_gui} to black stained glass pane named "&7" # Ustaw czarne szklo # Jeśli osiagnieto maksymalna liczbe slotow, zakoncz petle if {_counter} >= 18: stop open {_gui} to player command /kenugi []: trigger: evaluate "%arg%" on death: if attacker is a player: #Nie dziala if victim is a player: #Nie dziala wait 5 seconds set {_gui} to chest inventory with 3 rows named "&8➥ &eOcen gracza %attacker%" set {_uuid} to uuid of attacker set {_reputacja} to {reputacja::%{_uuid}%} send "&eDebug: Reputacja: %{_reputacja}%" to victim set {_typ} to get_reputacja(attacker) # Zmienione na "attacker" zamiast "victim" set slot 13 of {_gui} to skull of attacker named "&e%attacker's name%" with lore "&7Reputacja: %{_reputacja}% &7Typ: %{_typ}%" set slot 11 of {_gui} to green wool named "&aZwieksz reputacje" set slot 15 of {_gui} to red wool named "&cZmniejsz reputacje" open {_gui} to victim set {gui-attacker.%victim's uuid%} to {_uuid} command /zmienreputacje [] []: permission: reputacja.admin permission message: "&cNie masz uprawnien do uzywania tej komendy." trigger: if arg-1 is set: set {_target} to arg-1 else: set {_target} to player if arg-2 is a number: set {_ilosc} to arg-2 else: send "&cMusisz podac liczbe!" to player stop zmien_reputacje({_target}, {ilosc}, "Administrator") send "&eReputacja gracza %{_target}% zostala zmieniona o %{_ilosc}% punktow." to player send "&aTwoja reputacja zostala zmieniona o %{_ilosc}% punktow przez administratora." to {_target} command /sprawdzmojareputacje: trigger: set {_uuid} to uuid of player set {_reputacja} to {reputacja::%{_uuid}%} set {_typ} to get_reputacja(player) send "&eTwoja reputacja: &7%{_reputacja}% &8(&7Typ: %{_typ}%&8)" to player send "&eDebug: Odczytana reputacja: %{_reputacja}%, Typ: %{_typ}%" to player