Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function doorcheck():
- loop all players:
- add 1 to {_count}
- if {_count} is greater than or equal to 1:
- set {_query} to "SELECT * FROM Puertas"
- execute unsafe {_query} in {-sql} and store the result in {-Puertas::*}
- set {_nid} to 0
- loop {-Puertas::id::*}:
- add 1 to {_nid}
- set {_x} to "%{-Puertas::X::%{_nid}%}%"
- set {_y} to "%{-Puertas::Y::%{_nid}%}%"
- set {_z} to "%{-Puertas::Z::%{_nid}%}%"
- delete {Puerta.dueño_%{_x}%_%{_y}%_%{_z}%} and {Puerta.Invitado1_%{_x}%_%{_y}%_%{_z}%} and {Puerta.Invitado2_%{_x}%_%{_y}%_%{_z}%} and {Puerta.Invitado3_%{_x}%_%{_y}%_%{_z}%} and {Puerta.precio_%{_x}%_%{_y}%_%{_z}%} and {Puerta.id_%{_x}%_%{_y}%_%{_z}%}
- set {Puerta.dueño_%{_x}%_%{_y}%_%{_z}%} to "%{-Puertas::Dueno::%{_nid}%}%"
- set {Puerta.precio_%{_x}%_%{_y}%_%{_z}%} to "%{-Puertas::Precio::%{_nid}%}%" parsed as integer
- set {Puerta.Invitado1_%{_x}%_%{_y}%_%{_z}%} to "%{-Puertas::Inv1::%{_nid}%}%"
- set {Puerta.Invitado2_%{_x}%_%{_y}%_%{_z}%} to "%{-Puertas::Inv2::%{_nid}%}%"
- set {Puerta.Invitado3_%{_x}%_%{_y}%_%{_z}%} to "%{-Puertas::Inv3::%{_nid}%}%"
- set {Puerta.id_%{_x}%_%{_y}%_%{_z}%} to "%{-Puertas::id::%{_nid}%}%"
- set {Puerta.aldea_%{_x}%_%{_y}%_%{_z}%} to "%{-Puertas::aldea::%{_nid}%}%"
- else:
- wait 2 minute
- doorcheck()
- on load:
- doorcheck()
- on right click on left-hinged closed top iron door or right-hinged closed top iron door or left-hinged closed top oak wood door or right-hinged closed top oak wood door or left-hinged closed top acacia wood door or right-hinged closed top acacia wood door or left-hinged closed top birch wood door or right-hinged closed top birch wood door or left-hinged closed top dark oak wood door or right-hinged closed top dark oak wood door or left-hinged closed top spruce wood door or right-hinged closed top spruce wood door:
- set {_x} to x coord of event-block
- set {_y} to y coord of event-block
- set {_z} to z coord of event-block
- set {_puerta} to "%{_x}%_%{_y}%_%{_z}%"
- if {Puerta.id_%{_puerta}%} is set:
- if player is sneaking:
- cancel event
- p_ver(player, "%{_x}%", "%{_y}%", "%{_z}%")
- stop
- else:
- cancel event
- if {-EliminarPuerta.%player%} is true:
- set {_query} to "DELETE FROM Puertas WHERE `id`='%{_x}%%{_y}%%{_z}%'"
- execute unsafe {_query} in {-sql}
- subtract 1 from {Puerta.Puertas::%{Puerta.dueño_%{_puerta}%}%}
- set {_query} to "UPDATE Ajustes SET propiedades = ""%{Puerta.Puertas::%{Puerta.Puertas::%{Puerta.dueño_%{_puerta}%}%}%}%"" WHERE uuid = ""%uuid of {Puerta.Puertas::%{Puerta.dueño_%{_puerta}%}%}%"""
- execute unsafe {_query} in {-sql}
- delete {Puerta.id_%{_puerta}%} and {Puerta.dueño_%{_puerta}%} and {Puerta.precio_%{_puerta}%} and {impuesto_%{_puerta}%} and {Puerta.Invitado1_%{_puerta}%} and {Puerta.Invitado2_%{_puerta}%} and {Puerta.Invitado3_%{_puerta}%} and {Puerta.aldea_%{_puerta}%}
- send "&c¡Puerta eliminada con Exito!"
- set {-EliminarPuerta.%player%} to false
- stop
- if {Puerta.dueño_%{_puerta}%} or {Puerta.Invitado1_%{_puerta}%} or {Puerta.Invitado2_%{_puerta}%} or {Puerta.Invitado3_%{_puerta}%} is player:
- toggle event-block
- make player run command "/playsound minecraft:block.iron_door.close master %player% ~ ~ ~ 1" as op
- stop
- else:
- send "&c¡No tienes llaves para abrir esta puerta!" to player
- make player run command "/playsound minecraft:entity.villager.no master %player% ~ ~ ~ 1" as op
- stop
- else:
- if {-EliminarPuerta.%player%} is true:
- cancel event
- send "&c¡Esta puerta no esta registrada!"
- set {-EliminarPuerta.%player%} to false
- stop
- if {-AñadirPuerta.%player%} is true:
- cancel event
- p_add(player, "%{_x}%", "%{_y}%", "%{_z}%")
- delete {-Requiere.%player%}
- stop
- function p_add(p: player, x: text, y: text, z: text):
- set {_puerta} to "%{_x}%_%{_y}%_%{_z}%"
- if {-TipoAñadir.%{_p}%} is "Chica":
- set {Puerta.precio_%{_puerta}%} to 150
- if {-TipoAñadir.%{_p}%} is "Mediana":
- set {Puerta.precio_%{_puerta}%} to 450
- if {-TipoAñadir.%{_p}%} is "Grande":
- set {Puerta.precio_%{_puerta}%} to 800
- if {-TipoAñadir.%{_p}%} is "Mansion":
- set {Puerta.precio_%{_puerta}%} to 1500
- send "&2¡Puerta Añadida!" to {_p}
- if {-Requiere.%{_p}%} is set:
- set {Puerta.aldea_%{_puerta}%} to "%{-Requiere.%{_p}%}%"
- set {_query} to "INSERT INTO Puertas (`Dueno`, `Precio`, `X`, `Y`, `Z`, `id`, `aldea`) VALUES ('Disponible', '%{Puerta.precio_%{_puerta}%}%', '%{_x}%', '%{_y}%', '%{_z}%', '%{_x}%%{_y}%%{_z}%', '%{Puerta.aldea_%{_puerta}%}%');"
- else:
- set {_query} to "INSERT INTO Puertas (`Dueno`, `Precio`, `X`, `Y`, `Z`, `id`) VALUES ('Disponible', '%{Puerta.precio_%{_puerta}%}%', '%{_x}%', '%{_y}%', '%{_z}%', '%{_x}%%{_y}%%{_z}%');"
- execute unsafe {_query} in {-sql}
- set {Puerta.dueño_%{_puerta}%} to "Disponible"
- set {Puerta.id_%{_puerta}%} to "%{_x}%%{_y}%%{_z}%"
- delete {-TipoAñadir.%{_p}%} and {-AñadirPuerta.%{_p}%} and {-Requiere.%{_p}%}
- function p_ver(p: player, x: text, y: text, z: text):
- set {_puerta} to "%{_x}%_%{_y}%_%{_z}%"
- if {Puerta.precio_%{_puerta}%} is 150:
- set {_tipo} to "Chica"
- if {Puerta.precio_%{_puerta}%} is 450:
- set {_tipo} to "Mediana"
- if {Puerta.precio_%{_puerta}%} is 800:
- set {_tipo} to "Grande"
- if {Puerta.precio_%{_puerta}%} is 1500:
- set {_tipo} to "Mansion"
- if {Puerta.dueño_%{_puerta}%} is "Disponible":
- send "&6Propiedad &7- &aDisponible %nl% &6Precio&7 -&f %{Puerta.precio_%{_puerta}%}% &eRyos %nl%&6Tipo &7- &d%{_tipo}% %nl%" to {_p}
- json("%{_p}%", "&2&lAdquirir||cmd:/p-puerta %{_puerta}%||ttp:&fComprar la Propiedad||")
- else:
- if {Puerta.Invitado1_%{_puerta}%} is set:
- set {_inv1} to {Puerta.Invitado1_%{_x}%_%{_y}%_%{_z}%}
- else:
- set {_inv1} to ""
- if {Puerta.Invitado2_%{_x}%_%{_y}%_%{_z}%} is set:
- set {_inv2} to {Puerta.Invitado2_%{_x}%_%{_y}%_%{_z}%}
- else:
- set {_inv2} to ""
- if {Puerta.Invitado3_%{_x}%_%{_y}%_%{_z}%} is set:
- set {_inv3} to {Puerta.Invitado2_%{_x}%_%{_y}%_%{_z}%}
- else:
- set {_inv3} to ""
- send "&6Propiedad de &b%{Puerta.dueño_%{_puerta}%}%" to {_p}
- if "%{_inv1}%" and "%{_inv2}%" and "%{_inv3}%" is "":
- send "" to {_p}
- else:
- send "%nl% &6Invitados&7 - &f%{_inv1}% %{_inv2}% %{_inv3}% %nl%" to {_p}
- if {Puerta.dueño_%{_puerta}%} is {_p}:
- if {_tipo} is "Chica":
- return false
- else:
- if {_tipo} is "Mediana" or "Grande" or "Mansion":
- if {Puerta.Invitado1_%{_puerta}%} is set:
- json("%{_p}%", "&c&lEliminar&f a &d%{Puerta.Invitado1_%{_puerta}%}%||cmd:/p-puerta %{_puerta}% Eliminar 1||ttp:&fElimina a este Invitado de la puerta||")
- if {_tipo} is "Grande" or "Mansion":
- if {Puerta.Invitado2_%{_puerta}%} is set:
- json("%{_p}%", "&c&lEliminar&f a &d%{Puerta.Invitado2_%{_puerta}%}%||cmd:/p-puerta %{_puerta}% Eliminar 2||ttp:&fElimina a este Invitado de la puerta||")
- if {_tipo} is "Mansion":
- if {Puerta.Invitado3_%{_puerta}%} is set:
- json("%{_p}%", "&c&lEliminar&f a &d%{Puerta.Invitado3_%{_puerta}%}%||cmd:/p-puerta %{_puerta}% Eliminar 3||ttp:&fElimina a este Invitado de la puerta||")
- else:
- json("%{_p}%", "&a&lAñadir Invitado||cmd:/p-puerta %{_puerta}% añadir 3||ttp:&fAñade un invitado a tu propiedad||")
- else:
- json("%{_p}%", "&a&lAñadir Invitado||cmd:/p-puerta %{_puerta}% añadir 2||ttp:&fAñade un invitado a tu propiedad||")
- else:
- json("%{_p}%", "&a&lAñadir Invitado||cmd:/p-puerta %{_puerta}% añadir 1||ttp:&fAñade un invitado a tu propiedad||")
- send "&f%nl%&f %nl%" to {_p}
- json("%{_p}%", "&b&lTRANSFERIR&f||cmd:/p-puerta %{_puerta}% Transferir||ttp:&fTransfiere tu propiedad a otro usuario||")
- send "&f%nl%&f %nl%" to {_p}
- json("%{_p}%", "&a&lVENDER PROPIEDAD&f||cmd:/p-puerta %{_puerta}% Vender a||ttp:&fVender tu propiedad||")
- on chat:
- if {-TrasnferirJ::%player%} is true:
- if {-Cambiando::%player%} is true:
- send "&cYa estas transfiriendo una propiedad."
- else:
- if message is "cancelar" or "":
- delete {-TrasnferirJ::%player%}
- send "&cSe cancelo la Accion."
- stop
- if message is set:
- set {_r} to message parsed as player
- if {Puerta.Puertas::%{_r}%} is 3:
- send "&cEste jugador ya tiene el limite de propiedades"
- stop
- else:
- if {Puerta.aldea_%{-TempIDPuerta::%player%}%} is "Konohagakure" or "Kumogakure" or "Sunagakure" or "Iwagakure":
- if {aldea::%player%} is equal to {Puerta.aldea_%{_r}%}:
- if {_r} doesn't have permission "chuninquest":
- send "&c¡Este jugador tiene que ser minimo chunin!"
- else:
- send "&aSe envio la solicitud a &b%{_r}%"
- send "&6%player% &f quiere cederte los derechos de su propiedad." to {_r}
- json("%{_r}%", "&a&lAceptar Propiedad&f||cmd:/p-puerta %{-F::%player%}% Transferir para %{-Consul::%{_r}%}%||ttp:&fAceptar propiedad de %player% ||")
- set {-Consul::%{_r}%} to player
- set {-Cambiando::%player%} to true
- delete {-TrasnferirJ::%player%}
- wait 50 seconds
- if {-Consul::%{_r}%} is player:
- delete {-Consul::%{_r}%} and {-Cambiando::%player%}
- send "&cPaso el tiempo limite para aceptar la oferta" to {_r}
- send "&c%{_r}%&f No acepto la oferta de transferencia" to player
- else:
- delete {-Cambiando::%player%}
- stop
- else:
- send "&cDebes transferir esta propiedad solamente a otro miembro de la aldea!"
- else:
- if {_r} doesn't have permission "chuninquest":
- send "&c¡Este jugador tiene que ser minimo chunin!"
- else:
- send "&aSe envio la solicitud a &b%{_r}%"
- send "&6%player% &f quiere cederte los derechos de su propiedad." to {_r}
- set {-Consul::%{_r}%} to player
- set {-Cambiando::%player%} to true
- delete {-TrasnferirJ::%player%}
- json("%{_r}%", "&a&lAceptar Propiedad&f||cmd:/p-puerta %{-TempIDPuerta::%player%}% Transferir para %{-Consul::%{_r}%}%||ttp:&fAceptar propiedad de %player%||")
- wait 50 seconds
- if {-Consul::%{_r}%} is player:
- delete {-Consul::%{_r}%} and {-Cambiando::%player%}
- send "&cPaso el tiempo limite para aceptar la oferta" to {_r}
- send "&c%{_r}%&f No acepto la oferta de transferencia" to player
- else:
- delete {-Cambiando::%player%}
- stop
- if {-AñadiendoJ::%player%} is true:
- if message is "cancelar":
- delete {-AñadiendoJ::%player%}
- send "&cSe cancelo la Accion."
- if message is set:
- if {-TempNInv::%player%} is "1":
- if {Puerta.precio_%{-F::%player%}%} is 450 or 800 or 1500:
- set {_query} to "UPDATE Puertas SET Inv1 = ""%message%"" WHERE id = ""%{-TempIDPL::%player%}%"""
- set {Puerta.Invitado%{-TempIDPuerta::%player%}%} to message
- send "&fSe añadio a &a%message% &fa la propiedad!"
- set {_c} to "%message%" parsed as player
- send "&7[&6!&7] &b%player% &ate añadio a su propiedad" to {_c}
- if {-TempNInv::%player%} is "2":
- if {Puerta.precio_%{-F::%player%}%} is 800 or 1500:
- set {_query} to "UPDATE Puertas SET Inv2 = ""%message%"" WHERE id = ""%{-TempIDPL::%player%}%"""
- set {Puerta.Invitado%{-TempIDPuerta::%player%}%} to message
- send "&fSe añadio a &a%message% &fa la propiedad!"
- send "&7[&6!&7] &b%player% &ate añadio a su propiedad" to {_c}
- if {-TempNInv::%player%} is "3":
- if {Puerta.precio_%{-F::%player%}%} is 1500:
- set {_query} to "UPDATE Puertas SET Inv3 = ""%message%"" WHERE id = ""%{-TempIDPL::%player%}%"""
- set {Puerta.Invitado%{-TempIDPuerta::%player%}%} to message
- send "&fSe añadio a &a%message% &fa la propiedad!"
- send "&7[&6!&7] &b%player% &ate añadio a su propiedad" to {_c}
- execute unsafe {_query} in {-sql}
- delete {-TempIDPL::%player%} and {-TempNInv::%player%}
- delete {-TempIDPuerta::%player%}
- delete {-AñadiendoJ::%player%}
- stop
- else:
- stop
- command /p-puerta [<text>] [<text>] [<text>] [<player>]:
- trigger:
- if arg 1 is set:
- if arg 2 is "Transferir":
- if arg 3 is set:
- if {-Consul::%player%} is set:
- set {_query} to "UPDATE Puertas SET Dueno = ""%player%"", Inv1 = """", Inv2 = """", Inv3 = """" WHERE id = ""%{-TempIDPL::%arg-4%}%"""
- execute unsafe {_query} in {-sql}
- wait 0.1 seconds
- add 1 to {Puerta.Puertas::%player%}
- subtract 1 from {Puerta.Puertas::%arg-4%}
- set {_query} to "UPDATE Ajustes SET propiedades = ""%{Puerta.Puertas::%player%}%"" WHERE uuid = ""%uuid of player%"""
- execute unsafe {_query} in {-sql}
- wait 0.2 seconds
- set {_query} to "UPDATE Ajustes SET propiedades = ""%{Puerta.Puertas::%arg-4%}%"" WHERE uuid = ""%uuid of arg-4%"""
- execute unsafe {_query} in {-sql}
- set {Puerta.dueño_%arg-1%} to "%player%"
- send "&7[&6!&7] &2Se cedio la propiedad a &d%player%!" to arg-4
- send "&7[&6!&7] &b%arg-4% &ate cedio su propiedad" to player
- delete {Puerta.Invitado1_%{-TempIDPuerta::%arg-4%}%} and {Puerta.Invitado2_%{-TempIDPuerta::%arg-4%}%} and {Puerta.Invitado3_%{-TempIDPuerta::%arg-4%}%}
- delete {-TempIDPL::%arg-4%} and {-TempNInv::%arg-4%}
- delete {-TempIDPuerta::%arg-4%} and {-Consul::%player%}
- stop
- else:
- if {Puerta.dueño_%arg-1%} is player:
- set {-TrasnferirJ::%player%} to true
- set {_b} to arg-1
- replace every "_" with "" in {_b}
- set {-TempIDPL::%player%} to "%{_b}%"
- set {-F::%player%} to "%arg-1%"
- set {-TempIDPuerta::%player%} to "%arg-1%"
- send "&eEscribe el nombre del jugador que quieres ceder tu propiedad o &7&o(Cancelar)"
- stop
- else:
- send "&cNo puedes realizar esta accion."
- stop
- if arg 2 is "Vender":
- if arg 3 is "Aceptar":
- if {Puerta.dueño_%arg-1%} is player:
- set {_b} to arg-1
- replace every "_" with "" in {_b}
- set {_query} to "UPDATE Puertas SET Inv3 = """", Inv2 = """", Inv1 = """", Dueno = ""Disponible"" WHERE id = ""%{_b}%"""
- execute unsafe {_query} in {-sql}
- wait 0.3 seconds
- subtract 1 from {Puerta.Puertas::%player%}
- set {_query} to "UPDATE Ajustes SET propiedades = ""%{Puerta.Puertas::%player%}%"" WHERE uuid = ""%uuid of player%"""
- execute unsafe {_query} in {-sql}
- set {_dinero} to {Puerta.precio_%arg-1%} * 0.25
- delete {Puerta.Invitado1_%arg-1%} and {Puerta.Invitado2_%arg-1%} and {Puerta.Invitado3_%arg-1%}
- set {Puerta.dueño_%arg-1%} to "Disponible"
- send "&fVendiste tu propiedad por &2%{_dinero}% &eRyos" to player
- add {_dinero} to player's balance
- stop
- else:
- send "&c¡Tienes que ser el dueño de la propiedad!"
- stop
- else:
- send "&e&l¿ESTAS SEGURO?"
- send ""
- send "&fObtendras el valor del &c25%%&f del costo de la misma."
- send ""
- json("%player%", "&a&lCONFIRMAR||cmd:/p-puerta %arg-1% vender aceptar||ttp:&fVenderas tu propiedad||")
- stop
- if arg 2 is "Eliminar":
- if arg 3 is set:
- if {Puerta.dueño_%arg-1%} is player:
- send "&fSe &celimino&f a &d""%{Puerta.Invitado%arg-3%_%arg-1%}%""&f de la propiedad"
- send "&b%player% &cte elimino&f de su propiedad" to {Puerta.Invitado%arg-3%_%arg-1%}
- set {_b} to arg-1
- replace every "_" with "" in {_b}
- if arg 3 is "3":
- set {_query} to "UPDATE Puertas SET Inv3 = """" WHERE id = ""%{_b}%"""
- if arg 3 is "2":
- set {_query} to "UPDATE Puertas SET Inv2 = """" WHERE id = ""%{_b}%"""
- if arg 3 is "1":
- set {_query} to "UPDATE Puertas SET Inv1 = """" WHERE id = ""%{_b}%"""
- execute unsafe {_query} in {-sql}
- delete {Puerta.Invitado%arg-3%_%arg-1%}
- stop
- else:
- send "&c¡Debes ser el dueño de la propiedad!"
- stop
- if arg 2 is "Añadir":
- if arg 3 is set:
- if {Puerta.dueño_%arg-1%} is player:
- set {-AñadiendoJ::%player%} to true
- set {_b} to arg-1
- replace every "_" with "" in {_b}
- set {-TempIDPL::%player%} to "%{_b}%"
- set {-TempNInv::%player%} to "%arg-3%"
- set {-F::%player%} to "%arg-1%"
- set {-TempIDPuerta::%player%} to "%arg-3%_%arg-1%"
- send "&2Escribe el nombre del jugador que quieras invitar a tu propiedad o &7&o(Cancelar)"
- stop
- else:
- send "&c¡Debes ser el dueño de la propiedad!"
- stop
- if arg 2 is "Confirmar":
- if {Puerta.dueño_%arg-1%} isn't set:
- if {Puerta.Puertas::%player%} is 3:
- send "&c¡No puedes comprar mas propiedades!"
- stop
- else:
- if player's balance is greater or equal to {Puerta.precio_%arg-1%}:
- if {Puerta.aldea_%arg-1%} is set:
- send "%{Puerta.aldea_%arg-1%}%"
- if {aldea::%player%} is equal to {Puerta.aldea_%arg-1%}:
- set {Puerta.dueño_%arg-1%} to player
- send "&a¡Compraste el Lugar!"
- set {_b} to arg-1
- replace every "_" with "" in {_b}
- set {_query} to "UPDATE Puertas SET Dueno = ""%player%"" WHERE id = ""%{_b}%"""
- execute unsafe {_query} in {-sql}
- wait 2 ticks
- add 1 to {Puerta.Puertas::%player%}
- set {_query} to "UPDATE Ajustes SET propiedades = ""%{Puerta.Puertas::%player%}%"" WHERE uuid = ""%uuid of player%"""
- execute unsafe {_query} in {-sql}
- subtract {Puerta.precio_%arg-1%} from player's balance
- send "&fPropiedades: &c%{Puerta.Puertas::%player%}% &7/ &a3"
- stop
- else:
- send "&c¡No puedes comprar esta propiedad!"
- else:
- set {Puerta.dueño_%arg-1%} to player
- send "&a¡Compraste el Lugar!"
- set {_b} to arg-1
- replace every "_" with "" in {_b}
- set {_query} to "UPDATE Puertas SET Dueno = ""%player%"" WHERE id = ""%{_b}%"""
- execute unsafe {_query} in {-sql}
- wait 2 ticks
- add 1 to {Puerta.Puertas::%player%}
- set {_query} to "UPDATE Ajustes SET propiedades = ""%{Puerta.Puertas::%player%}%"" WHERE uuid = ""%uuid of player%"""
- execute unsafe {_query} in {-sql}
- subtract {Puerta.precio_%arg-1%} from player's balance
- send "&fPropiedades: &c%{Puerta.Puertas::%player%}% &7/ &a3"
- stop
- else:
- send "&cNo tienes fondos suficientes para adquirir esto!"
- stop
- if {Puerta.dueño_%arg-1%} is "Disponible":
- if player doesn't have permission "chuninquest":
- send "&c¡No puedes comprar propiedades siendo Genin!"
- stop
- if {Puerta.Puertas::%player%} is 3:
- send "&c¡No puedes comprar mas propiedades!"
- stop
- else:
- if player's balance is greater or equal to {Puerta.precio_%arg-1%}:
- if {Puerta.aldea_%arg-1%} is equal to "Konohagakure" or "Iwagakure" or "Kumogakure" or "Sunagakure":
- if {aldea::%player%} is equal to {Puerta.aldea_%arg-1%}:
- set {Puerta.dueño_%arg-1%} to player
- send "&a¡Compraste el Lugar!"
- set {_b} to arg-1
- replace every "_" with "" in {_b}
- set {_query} to "UPDATE Puertas SET Dueno = ""%player%"" WHERE id = ""%{_b}%"""
- execute unsafe {_query} in {-sql}
- wait 2 ticks
- add 1 to {Puerta.Puertas::%player%}
- set {_query} to "UPDATE Ajustes SET propiedades = ""%{Puerta.Puertas::%player%}%"" WHERE uuid = ""%uuid of player%"""
- execute unsafe {_query} in {-sql}
- subtract {Puerta.precio_%arg-1%} from player's balance
- send "&fPropiedades: &c%{Puerta.Puertas::%player%}% &7/ &a3"
- stop
- else:
- send "&c¡No puedes comprar esta propiedad! Solo miembros de &7&o(%{Puerta.aldea_%arg-1%}%&7&o)"
- else:
- set {Puerta.dueño_%arg-1%} to player
- send "&a¡Compraste el Lugar!"
- set {_b} to arg-1
- replace every "_" with "" in {_b}
- set {_query} to "UPDATE Puertas SET Dueno = ""%player%"" WHERE id = ""%{_b}%"""
- execute unsafe {_query} in {-sql}
- wait 2 ticks
- add 1 to {Puerta.Puertas::%player%}
- set {_query} to "UPDATE Ajustes SET propiedades = ""%{Puerta.Puertas::%player%}%"" WHERE uuid = ""%uuid of player%"""
- execute unsafe {_query} in {-sql}
- subtract {Puerta.precio_%arg-1%} from player's balance
- send "&fPropiedades: &c%{Puerta.Puertas::%player%}% &7/ &a3"
- stop
- else:
- send "&cNo tienes fondos suficientes para adquirir esto!"
- stop
- else:
- send "&c¡Ya tiene un dueño esta puerta!"
- stop
- if {Puerta.dueño_%arg-1%} is "Disponible":
- send "&fEl precio es de &e%{Puerta.precio_%arg-1%}% Ryos&f."
- send ""
- json("%player%", "&2&lAceptar||cmd:/p-puerta %arg-1% confirmar||ttp:&fComprar el lugar por %{Puerta.precio_%arg-1%}% Ryos||")
- stop
- else:
- send "&c¡Ya tiene un dueño esta puerta!"
- stop
- on right click on spruce wood door or acacia wood door or oak wood door or dark oak wood door or birch wood door or closed southward bottom spruce wood door or closed southward bottom acacia wood door or closed southward bottom oak wood door or closed southward bottom dark oak wood door or closed southward bottom birch wood door or closed westward bottom spruce wood door or closed westward bottom acacia wood door or closed westward bottom oak wood door or closed westward bottom dark oak wood door or closed westward bottom birch wood door or closed northward bottom spruce wood door or closed northward bottom acacia wood door or closed northward bottom oak wood door or closed northward bottom dark oak wood door or closed northward bottom birch wood door:
- cancel event
- stop
- command /Propiedades:
- trigger:
- send "&aPropiedades: &c%{Puerta.Puertas::%player%}% &7/ &a3"
- send ""
- command /Puerta [<text>] [<text>] [<text>]:
- permission: stafflvl2
- trigger:
- if arg 1 isn't set:
- send "&cComandos Validos."
- send ""
- send "&a/puerta Añadir [Tipo] &7(Chica, Mediana, Grande, Mansion)"
- send "&a/puerta Eliminar"
- if arg 1 is "Eliminar":
- set {-EliminarPuerta.%player%} to true
- send "&cDale click derecho a la parte superior de una puerta!"
- stop
- if arg 1 is "Añadir":
- if arg 2 isn't set:
- send "&cDebes añadir el tipo de Lugar &f(Chica, Mediana, Grande, Masion)"
- stop
- if arg 2 is "Chica" or "Mediana" or "Grande" or "Mansion":
- if arg 3 is "hoja" or "arena" or "nube" or "roca":
- set {-AñadirPuerta.%player%} to true
- set {-TipoAñadir.%player%} to arg-2
- if arg 3 is "hoja":
- set {-Requiere.%player%} to "Konohagakure"
- if arg 3 is "arena":
- set {-Requiere.%player%} to "Sunagakure"
- if arg 3 is "nube":
- set {-Requiere.%player%} to "Kumogakure"
- if arg 3 is "roca":
- set {-Requiere.%player%} to "Iwagakure"
- send "&eDale click derecho a la parte superior de una puerta!"
- else:
- set {-AñadirPuerta.%player%} to true
- set {-TipoAñadir.%player%} to arg-2
- send "&aDale click derecho a la parte superior de una puerta!"
- else:
- send "&cDebes añadir el tipo de Lugar &f(Chica, Mediana, Grande, Masion)"
- stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement