Jak napisać linię kodu która sprawdza odległość gracza od lokalizacji zapisanej w zmiennej grupowej, gdyż jak napisałem takie coś to nie działa.
if distance between {zmienna::*} and location of player is greater than 10:
options:
lej: 154 named "&7Hopper"
on load:
register new shaped recipe for {@lej} using block of iron, air, block of iron, block of iron, chest, block of iron, air, block of iron, air
on craft:
if event-item is hopper named "&7Hopper":
stop
else:
cancel event
A warunek do niej jak napisać, gdyż po wpisaniu takiej linijki kodu wyskakują błędy
if distance between {zmienna::*} and location of player is greater than 10:
Napisałem taki skrypt i zastanawiam się jak dodać do tego kodu zabezpieczenie żeby inny gracz nie mógł zakładać działki na terenie na którym już jest założona działka przez innego gracza
command /dzialka [<text>]:
trigger:
if arg 1 is "zaloz":
if distance between {ustawiony.spawn} and location of player is greater than 1:
if {posiadanie.dzialki.%player%} is not set:
set {posiadanie.dzialki.%player%} to true
set {dom.dzialka.%player%} to location of player
set {srodek.dzialka.%name of player%} to location of player
add {srodek.dzialka.%player%} to {jakas.dzialka}
op the player
Execute player command "//pos1"
Execute player command "//pos2"
Execute player command "//expand 20 n"
Execute player command "//expand 20 s"
Execute player command "//expand 20 e"
Execute player command "//expand 20 w"
Execute player command "//walls 101"
Execute player command "//expand vert"
Execute player command "/rg define dzialka%player%"
Execute player command "/rg addowner dzialka%player% %player%"
deop the player
else:
send "&4Posiadasz juz dzialke"
else:
send "&4za blisko spawn"
if arg 1 is "usun":
if {posiadanie.dzialki.%player%} is set:
clear {posiadanie.dzialki.%player%}
clear {srodek.dzialka.%player%}
op the player
Execute player command "/rg remove dzialka%player%"
deop the player
else:
send "&4nie posiadasz dzialki"
if arg 1 is "dodaj":
if arg 1 is "wyrzuc":
if arg 1 is "dom":
if arg 1 is "ustawdom":
if arg 1 is "ustawspawn":
if player have permissions "dzialki.admin":
set {ustawiony.spawn} to location of player
send "&4ustawiono spawn dzialki"