ajout d'une securité dans le sethome et de flexibilité dans le delhome

This commit is contained in:
Mylloon 2021-03-09 14:37:47 +01:00
parent bd2c4832ad
commit f0b3567b91

23
main.sk
View file

@ -72,21 +72,32 @@ command sethome [<text>]:
set {_name} to "maison" set {_name} to "maison"
else: else:
set {_name} to text-arg set {_name} to text-arg
if {home.%player's uuid%.%{_name}%} is set:
if text-arg isn't set:
set {_name} to ""
else:
set {_name} to "%{_name}% "
send "&4Cette maison existe déjà, &8/delhome %{_name}%&4pour la supprimer."
else:
remove {_name} from {home.%player's uuid%::*} remove {_name} from {home.%player's uuid%::*}
add {_name} to {home.%player's uuid%::*} add {_name} to {home.%player's uuid%::*}
set {home.%player's uuid%.%{_name}%} to player's location set {home.%player's uuid%.%{_name}%} to player's location
send "Ta maison '&a%{_name}%&r' est maintenant définie aux coordonnées &7%player's location%&r !" send "Ta maison '&a%{_name}%&r' est maintenant définie aux coordonnées &7%player's location%&r !"
command delhome <text>: command delhome [<text>]:
description: Supprime le tp vers ta maison description: Supprime le tp vers ta maison
executable by: players executable by: players
trigger: trigger:
if {home.%player's uuid%.%text-arg%} is set: if text-arg isn't set:
remove text-arg from {home.%player's uuid%::*} set {_name} to "maison"
clear {home.%player's uuid%.%text-arg%}
send "Maison &a%text-arg%&r supprimée."
else: else:
send "&4Ce home n'existe pas." set {_name} to text-arg
if {home.%player's uuid%.%{_name}%} is set:
remove {_name} from {home.%player's uuid%::*}
clear {home.%player's uuid%.%{_name}%}
send "Maison '&a%{_name}%&r' supprimée."
else:
send "&4Cette maison n'existe pas."
make player execute command "listhome" make player execute command "listhome"
command home [<text>]: command home [<text>]: