# # System żyć na serwer survival # [hLIFE] v0.2 Hervus_ 07/2019 # variables: {maxLifesAmount} = 3 # Maksymalnie 25, powyżej - skrypt może nie działać options: lifeTransfer: &2Przekazałeś życie -> &f%arg 2% personHasMaxLifesAmount: &cPodana osoba ma maksymalną liczbę żyć. (%{maxLifesAmount}%) # Kiedy osoba której wysyłamy życie osiągnie ich maksymalną liczbę. unexistNickname: &cNie ma takiego nicku w bazie. # Kiedy zmienna {life::player} nie jest ustawiona dla podawanego gracza, tzn. gracz nie był nigdy na serwerze. dontBeCrazy: &cNo już przestań kombinować xd # Kiedy próbujemy wysłaś życie do samego siebie. cannotTransferLastLife: &cNie możesz oddać swojego ostatniego życia. # Oznacza, że nie ma możliwości oddania tylu żyć, aby zostało 0. lifeItem: diamond # Przedmiot dodający życie po kliknięciu PPM trzymając go w ręku. (default: diamond) lifeItemEatSound: item.totem.use # Dźwięk podczas zjadania przedmiotu dodającego życie. (default: item.totem.use) Lista dźwięków MC 1.9: https://www.digminecraft.com/lists/sound_list_pc.php yummyItemMessage: &3&lMmm... Smaczne! Twoje życia: &f%{life::%player%}% # Wiadmomość do gracza, kiedy zje przedmiot, czyli doda sobie jedno życie. # Użyta zmienna zależna jest od końcówki; "jedno życiE", "dwa życiA", "zero żyĆ". # Podczas zmian zwróć uwagę gdzie jest 'sender', a gdzie 'arg 2'. (sender = player) checkLifes: &3&lPosiadasz &f&l%{life::%sender%}% &3&lżyć checkLifesE: &3&lPosiadasz &f&l%{life::%sender%}% &3&lżycie checkLifesA: &3&lPosiadasz &f&l%{life::%sender%}% &3&lżycia checkOtherPersonLifes: &3&l%arg 2% posiada &f&l%{life::%arg 2%}% &3&lżyć checkOtherPersonLifesE: &3&l%arg 2% posiada &f&l%{life::%arg 2%}% &3&lżycie checkOtherPersonLifesA: &3&l%arg 2% posiada &f&l%{life::%arg 2%}% &3&lżycia lostOneLife: &cStraciłeś jedno życie :( # Wiadomość na chacie po utracie jednego, ale nie ostatniego życia lostLastLife: &cNiestety straciłeś ostatnie życie, czas się żegnać... # Wiadomość na chacie po utracie ostatniego życia kickMessage: &4&lNie posiadasz żyć... poproś kogoś, by oddał ci jedno. # Powód kick'a po utracie ostatniego życia banMessage: &4&lNie posiadasz żyć... poproś znajomych, by oddali ci jedno. # Powód kick'a przy próbie wejścia na serwer po utracie wszystkich żyć (nie jest to ban) timeDelayToKick: 10 # Czas w sekundach pomiędzy utratą ostatniego życia, a kickiem (powód kicka: kickMessage) youAreAZombie: &cW zasadzie jesteś już martwy xd # Kiedy gracz sprawdza ilość swoich żyć po utracie ostatniego. Ma taką możliwość, ponieważ 'timeDelayToKick' # Jeśli te bloki są na celowniku nie można zjeść przedmiotu dodającego życie. blockedTargetBlock: item frame, furnace, enchanting table, chest or workbench # Kiedy zabraknie niezbędnych argumentów syntaxErrorA: &cUżyj: &f/life give syntaxErrorB: &cUżyj: &f/life check # - CODE AT LEAST on first join: set {life::%player%} to {maxLifesAmount} on join: if {life::%player%} <= 0: kick player due to "{@banMessage}" on right click with {@lifeItem}: if player's gamemode is survival: if player's targeted block is not {@blockedTargetBlock}: if {life::%player%} <= ({maxLifesAmount}-1): wait 5 tick play sound "{@lifeItemEatSound}" with volume 5 at player remove 1 {@lifeItem} from player add 1 to {life::%player%} send "{@yummyItemMessage}" on death of player: if {life::%victim%} > 1: remove 1 from {life::%victim%} send "{@lostOneLife}" to victim stop if {life::%victim%} = 1: set {life::%victim%} to 0 send "{@lostLastLife}" to victim wait {@timeDelayToKick} second kick victim due to "{@kickMessage}" command /lifemc [] [] []: permission: skript.life.operator trigger: if arg 1 is not set: send "&5Komenda &f/life [give|check] [nick] - &5Permisja: &fbrak" send "&5Komenda &f/lifemc - &5Permisja: &fskript.life.operator" send "&eLimit żyć dla jednego gracza: &f%{maxLifesAmount}%" if arg 1 is "give": if arg 2 is set: if arg 2 != sender: if {life::%sender%} > 1: if {life::%arg 2%} is set: if {life::%arg 2%} < {maxLifesAmount}: add 1 to {life::%arg 2%} remove 1 from {life::%sender%} send "{@lifeTransfer}" to sender else: send "{@personHasMaxLifesAmount}" else: send "{@unexistNickname}" else: send "{@cannotTransferLastLife}" else: send "{@dontBeCrazy}" else: send "{@syntaxErrorA}" stop if arg 1 is "check": if arg 2 is set: if {life::%arg 2%} is set: clear {_numb} set {_numb} to {life::%arg 2%} send "{@checkOtherPersonLifes}" if {_numb} = 0 send "{@checkOtherPersonLifesE}" if {_numb} = 1 send "{@checkOtherPersonLifesA}" if {_numb} = 2 send "{@checkOtherPersonLifesA}" if {_numb} = 3 send "{@checkOtherPersonLifesA}" if {_numb} = 4 send "{@checkOtherPersonLifes}" if {_numb} = 25 if {_numb} >= 5: if {_numb} <= 21: send "{@checkOtherPersonLifes}" if {_numb} > 22: if {_numb} <= 24: send "{@checkOtherPersonLifesA}" else: send "{@unexistNickname}" else: clear {_numb} set {_numb} to {life::%sender%} send "{@youAreAZombie}" if {_numb} = 0 send "{@checkLifesE}" if {_numb} = 1 send "{@checkLifesA}" if {_numb} = 2 send "{@checkLifesA}" if {_numb} = 3 send "{@checkLifesA}" if {_numb} = 4 send "{@checkLifes}" if {_numb} = 25 if {_numb} >= 5: if {_numb} <= 21: send "{@checkLifes}" if {_numb} >= 22: if {_numb} <= 24: send "{@checkLifesA}" # - PONIŻEJ WSZYSTKO DLA OPERATORÓW, WIĘC NIE MA KOLOROWYCH WIADOMOŚCI :v if arg 1 is "add": if arg 2 is set: if arg 3 is set: if {life::%arg 2%} is set: if (arg 3 + {life::%arg 2%}) <= {maxLifesAmount}: add arg 3 to {life::%arg 2%} send "Dodano %arg 3% dla %arg 2%" else: send "Nie możesz przekroczyć limitu wynoszącego %{maxLifesAmount}% żyć na gracza." send "Możesz dodać mu maksymalnie %({maxLifesAmount} - {life::%arg 2%})% żyć" else: send "Nie znaleziono gracza w bazie" else: send "Użyj: /lifemc add " else: send "Użyj: /lifemc add " if arg 1 is "remove": if arg 2 is set: if arg 3 is set: if {life::%arg 2%} is set: if arg 3 <= {life::%arg 2%}: remove arg 3 from {life::%arg 2%} send "Usunięto %arg 3% żyć graczowi %arg 2%. Aktualny stan jego żyć: %{life::%arg 2%}%" else: send "Życia gracza %arg 2%: %{life::%arg 2%}%. Nie możesz usunąć więcej niż ma!" else: send "Nie znaleziono gracza w bazie." else: send "Użyj: /lifemc remove " else: send "Użyj: /lifemc remove " if arg 1 is "set": if arg 2 is set: if arg 3 is set: if {life::%arg 2%} is set: if arg 3 <= {maxLifesAmount}: set {life::%arg 2%} to arg 3 send "Ustawiono %arg 3% żyć dla %arg 2%" else: send "Nie możesz przekroczyć limitu %{maxLifesAmount}% żyć dla jednego gracza." else: send "Nie znaleziono gracza w bazie" else: send "Użyj: /lifemc set " else: send "Użyj: /lifemc set " if arg 1 is "max": if arg 2 is "set": if arg 3 is set: set {maxLifesAmount} to arg 3 loop {life::*}: if {life::%loop-index%} > arg 3: set {life::%loop-index%} to arg 3 send "Nowy limit żyć: %arg 3%" else: send "Użyj: /lifemc max set Podaj nowy limit. Aktualny: %{maxLifesAmount}%" else: send "Użyj: /lifemc max set Podaj nowy limit. Aktualny: %{maxLifesAmount}%" command /life [] []: trigger: if arg 1 is set: if arg 1 is "give": if arg 2 is set: if arg 2 is not sender: make player execute command "/lifemc give %arg 2%" with permission "skript.life.operator" else: make player execute command "/lifemc give %sender%" with permission "skript.life.operator" else: send "{@syntaxErrorA}" if arg 1 is "check": if arg 2 is set: if arg 2 is not sender: make player execute command "/lifemc check %arg 2%" with permission "skript.life.operator" else: make player execute command "/lifemc check" with permission "skript.life.operator" else: send "{@syntaxErrorB}" else: make sender execute command "/lifemc check" with permission "skript.life.operator" # --- END OF FILE --- #