Pourquoi pas mais la j'ai finis voilà le skript:
Il peut y avoir des bugs ou des erreurs prévient moi dans ce cas et oublie pas de télécharger les add-ons de PsYZiiK si il y a des erreurs car moi il y en a pas
[spoiler=Code]
options:
prefix: &8[&6Tournoi&8]&e
permission setspawn: tournoi.setspawn
permission start: tournoi.start
on load:
if {tournoi.start} is not set:
set {tournoi.start} to false
on join:
if {tournoi.deco.%player%} is set:
wait 10 tick
make player execute "hub"
clear player's inventory
set helmet of player to air
set chestplate of player to air
set legging of player to air
set boots of player to air
if {tournoi.start} is true:
send "{@prefix} Un tournoi va bientôt commencer fais /tournoi join pour le rejoindre."
function TournoiJoin(sert à rien: integer): #Enleve rien c'est juste pour que la fonction marche
broadcast "{@prefix} &cIl n'y a pas assez de joueurs pour lancer le tournoi, faites /tournoi join pour le rejoindre."
wait 30 seconds
loop all players:
if {tournoi.joueurs::%loop-player%} is set:
add 1 to {_tournoi}
if {_tournoi} is 1:
TournoiJoin(0)
else:
loop {tournoi.joueurs::*}:
set {_joueur} to loop-value
send "{@prefix} Le tournoi a commencer." to {_joueur}
clear {_joueur}'s inventory
teleport {_joueur} to {tournoi.spawn}
give stone sword to {_joueur}
set helmet of {_joueur} to leather helmet
set chestplate of {_joueur} to leather chestplate
set legging of {_joueur} to leather leggings
set boots of {_joueur} to leather boots
command /tournoi [<text>]:
trigger:
if arg is "start":
if player has permission "{@permission start}":
if {tournoi.start} is false:
set {tournoi.start} to true
broadcast "{@prefix} Un tournoi commence dans 30 secondes faites /tournoi join pour le rejoindre."
wait 30 seconds
if {tournoi.start} is true:
loop all players:
if {tournoi.joueurs::%loop-player%} is set:
add 1 to {_tournoi}
if {_tournoi} is 1:
TournoiJoin(0)
else:
set {tournoi.start} to "start"
loop {tournoi.joueurs::*}:
set {_joueur} to loop-value
send "{@prefix} Le tournoi a commencer." to {_joueur}
clear {_joueur}'s inventory
teleport {_joueur} to {tournoi.spawn}
give stone sword to {_joueur}
set helmet of {_joueur} to leather helmet
set chestplate of {_joueur} to leather chestplate
set legging of {_joueur} to leather leggings
set boots of {_joueur} to leather boots
else:
send "{@prefix} &cUn tournoi est déjà en cours."
else:
send "{@prefix} &cVous n'avez pas accès à cette commande."
else if arg is "stop":
if {tournoi.start} is true or "start":
broadcast "{@prefix} Le tournoi a été stoppé."
set {tournoi.start} to false
loop all players:
if {tournoi.joueurs::%loop-player%} is set:
make loop-player execute "hub"
clear {tournoi.joueurs::*}
else:
send "{@prefix} &cIl n'y a pas de tournoi en cours."
else if arg is "join":
if {tournoi.start} is true:
if {tournoi.joueurs::%player%} is set:
send "{@prefix} &cVous avez déjà rejoint le tournoi."
else:
send "{@prefix} Vous avez rejoint le tournoi."
set {tournoi.joueurs::%player%} to player
else if {tournoi.start} is "start":
send "{@prefix} &cLe tournoi est déjà commencer."
else:
send "{@prefix} &cIl n'y a pas de tournoi en cours."
else if arg is "leave":
if {tournoi.start} is true:
if {tournoi.joueurs::%player%} is set:
send "{@prefix} Vous avez quitté le tournoi."
delete {tournoi.joueurs::%player%}
else:
send "{@prefix} &cVous n'avez pas rejoint un tournoi."
else if {tournoi.start} is "start":
send "{@prefix} &cLe tournoi est déjà commencer."
else:
send "{@prefix} &cIl n'y a pas de tournoi en cours."
else if arg is "setspawn":
if player has permission "{@permission setspawn}":
set {tournoi.spawn} to player's location
send "{@prefix} Le spawn est désormais défini à votre position."
else:
send "{@prefix} &cVous n'avez pas accès à cette commande."
on place:
if {tournoi.joueurs::%player%} is set:
cancel event
on death:
if {tournoi.start} is "start":
if {tournoi.joueurs::%victim%} is set:
heal victim
make victim execute "hub"
clear victim's inventory
set helmet of victim to air
set chestplate of victim to air
set legging of victim to air
set boots of victim to air
clear {tournoi.joueurs::%victim%}
loop all players:
if {tournoi.joueurs::%loop-player%} is set:
add 1 to {_tournoi}
if {_tournoi} is 1:
set {_joueur} to "%{tournoi.joueurs::*}%"
broadcast "{@prefix} %victim% est mort(e), %{_joueur}% remporte le tournoi !"
make {_joueur} execute "hub"
clear {_joueur}'s inventory
set helmet of {_joueur} to air
set chestplate of {_joueur} to air
set legging of {_joueur} to air
set boots of {_joueur} to air
set {tournoi.start} to false
clear {tournoi.joueurs::*}
else:
broadcast "{@prefix} %victim% est mort(e), il reste encore %{_tournoi}% joueurs."
else if {tournoi.start} is true:
if {tournoi.joueurs::%victim%} is set:
delete {tournoi.joueurs::%victim%}
on quit:
if {tournoi.start} is "start":
if {tournoi.joueurs::%player%} is set:
clear {tournoi.joueurs::%player%}
set {tournoi.deco.%player%} to true
loop all players:
if {tournoi.joueurs::%loop-player%} is set:
add 1 to {_tournoi}
if {_tournoi} is 1:
set {_joueur} to "%{tournoi.joueurs::*}%"
broadcast "{@prefix} %player% a déconnecté, %{_joueur}% remporte le tournoi !"
make {_joueur} execute "hub"
set {tournoi.start} to false
clear {tournoi.joueurs::*}
else:
broadcast "{@prefix} %player% a déconnecté, il reste encore %{_tournoi}% joueurs."
else if {tournoi.start} is true:
if {tournoi.joueurs::%player%} is set:
delete {tournoi.joueurs::%player%}