update all comments

This commit is contained in:
Mylloon 2021-11-14 03:13:58 +01:00
parent cbcd6c11c7
commit 0e9b49310c
7 changed files with 109 additions and 52 deletions

View file

@ -1,9 +1,12 @@
# named with a 0 at the begining to be sure he is load first # named with a 0 at the begining to be sure he is loaded first
# the goal of this file is to load all the function who are used
# by a lot of my other files
on load: on load:
ScriptList("add", script) ScriptList("add", script)
on unload: on unload:
ScriptList("remove", script) ScriptList("remove", script)
# avoids having to type the same message several times (e.g. the error message)
function option(option: text) :: text: # options function option(option: text) :: text: # options
if {_option} is "serverName": if {_option} is "serverName":
set {_resultat} to "Serveur d'Anri" set {_resultat} to "Serveur d'Anri"
@ -11,18 +14,23 @@ function option(option: text) :: text: # options
set {_resultat} to "&4Tu n'as pas la permission d'utiliser cette commande." set {_resultat} to "&4Tu n'as pas la permission d'utiliser cette commande."
return {_resultat} return {_resultat}
function sendToOperators(player: player, message: text): # envoie message aux opérateurs (exclu le player s'il est OP aussi) # sends message to operators (excludes the player if he's OP too)
function sendToOperators(player: player, message: text):
loop all players: loop all players:
if loop-player is a op: if loop-player is a op:
if loop-player is not {_player}: if loop-player is not {_player}:
send {_message} to loop-player send {_message} to loop-player
# allows to add or remove a file to the list of scripts files
# all files add their names to the list when they are loaded
# and remove them when they are unloaded
function ScriptList(addRemove: text, list: text): function ScriptList(addRemove: text, list: text):
if {_addRemove} is "add": if {_addRemove} is "add":
add {_list} to {scripts::*} add {_list} to {scripts::*}
if {_addRemove} is "remove": if {_addRemove} is "remove":
remove {_list} from {scripts::*} remove {_list} from {scripts::*}
# returns the name taking into account his possible nickname
function userOrNick(player: player) :: text: function userOrNick(player: player) :: text:
set {_uuid} to uuid of {_player} set {_uuid} to uuid of {_player}
if {nick.%{_uuid}%} is set: if {nick.%{_uuid}%} is set:
@ -31,15 +39,13 @@ function userOrNick(player: player) :: text:
set {_res} to "%{_player}%" set {_res} to "%{_player}%"
return {_res} return {_res}
# returns an "s" if arg "number" is higher than 1
function pluriel(int: number) :: text: function pluriel(int: number) :: text:
set {_pluriel} to "" set {_pluriel} to ""
set {_pluriel} to "s" if {_int} > 1 set {_pluriel} to "s" if {_int} > 1
return {_pluriel} return {_pluriel}
function annonceParty(message: text): # reset the thimble game
loop {party.list::*}:
send {_message} to loop-value
function resetThimble(player: player): function resetThimble(player: player):
set {_uuid} to uuid of {_player} set {_uuid} to uuid of {_player}
delete {thimble.dead.%{_uuid}%} delete {thimble.dead.%{_uuid}%}

13
chat.sk
View file

@ -3,12 +3,14 @@ on load:
on unload: on unload:
ScriptList("remove", script) ScriptList("remove", script)
on chat: # chat # custom chat
on chat:
cancel event cancel event
set {_player} to userOrNick(player) set {_player} to userOrNick(player)
broadcast "&8[%gamemode of player%&8]&r %{_player}%&r &8➡&r %colored message%" in all worlds broadcast "&8[%gamemode of player%&8]&r %{_player}%&r &8➡&r %colored message%" in all worlds
command nickname [<player>] [<text>]: # changement de pseudo # adding nickname option to all users
command nickname [<player>] [<text>]:
executable by: players executable by: players
aliases: nick aliases: nick
description: Change ton nom ou celui d'un autre joueur. (max 15 charactères) description: Change ton nom ou celui d'un autre joueur. (max 15 charactères)
@ -42,7 +44,8 @@ command nickname [<player>] [<text>]: # changement de pseudo
set {nick.%{_playerUUID}%} to colored arg-2 set {nick.%{_playerUUID}%} to colored arg-2
send "&6Ton surnom est désormais &r%{nick.%{_playerUUID}%}%&6. (changé par %{_playerNAME}%&6)" to {_player} send "&6Ton surnom est désormais &r%{nick.%{_playerUUID}%}%&6. (changé par %{_playerNAME}%&6)" to {_player}
command msg <player> <text>: # DM # adding better DM option
command msg <player> <text>:
executable by: players executable by: players
aliases: whisper, w, tell, t aliases: whisper, w, tell, t
description: Envoie un message privé à un joueur. description: Envoie un message privé à un joueur.
@ -52,7 +55,9 @@ command msg <player> <text>: # DM
set {dmReply.%uuid of player%} to arg-1 set {dmReply.%uuid of player%} to arg-1
set {dmReply.%uuid of arg-1%} to player set {dmReply.%uuid of arg-1%} to player
command reponse <text>: # réponse à un DM # add the ability to reply to a message without
# having to specify the receiver
command reponse <text>:
executable by: players executable by: players
aliases: rep, r aliases: rep, r
description: Envoie un réponse à un joueur. description: Envoie un réponse à un joueur.

View file

@ -1,7 +1,7 @@
options: options:
X1: 103.5 X1: 103.5
Z1: -312.5 Z1: -312.5
Yeau: 57.5 Yeau: 57.5 # water layer
X2: 99.5 X2: 99.5
Z2: -304.5 Z2: -304.5
@ -10,7 +10,13 @@ on load:
on unload: on unload:
ScriptList("remove", script) ScriptList("remove", script)
command deacoudre [<text>]: # lancement de la partie # allows you to send a message to a whole party
function annonceParty(message: text):
loop {party.list::*}:
send {_message} to loop-value
# starting a thimble game for a party
command deacoudre [<text>]:
executable by: players executable by: players
description: Lance une partie de dé à coudre. description: Lance une partie de dé à coudre.
trigger: trigger:
@ -47,6 +53,7 @@ command deacoudre [<text>]: # lancement de la partie
else: else:
send "&4Tu n'es pas dans une partie." send "&4Tu n'es pas dans une partie."
# returns the difference between the xyz-location of a block and a given number
function getDifference(arg: text, block: block, comparative: number) :: number: function getDifference(arg: text, block: block, comparative: number) :: number:
if {_arg} is "x": if {_arg} is "x":
set {_res} to difference between X-location of {_block} and {_comparative} set {_res} to difference between X-location of {_block} and {_comparative}
@ -56,7 +63,8 @@ function getDifference(arg: text, block: block, comparative: number) :: number:
set {_res} to difference between Z-location of {_block} and {_comparative} set {_res} to difference between Z-location of {_block} and {_comparative}
return {_res} return {_res}
every 0.5 second in "world": # pose du bloc et téléporatation # placing block and teleportation
every 0.5 second in "world":
if {thimble} is not true: if {thimble} is not true:
stop stop
loop {party.list::*}: loop {party.list::*}:
@ -76,7 +84,7 @@ every 0.5 second in "world": # pose du bloc et téléporatation
continue continue
if {_zLocationBlock1} and {_zLocationBlock2} >= abs({@Z1} - {@Z2}): if {_zLocationBlock1} and {_zLocationBlock2} >= abs({@Z1} - {@Z2}):
continue continue
# vérification si c'est un jump qui est dur à faire (entre 4 blocs pleins) # vérification si c'est un jump qui est dur à faire (entre 4 blocs pleins)
set {_niceJump} to true set {_niceJump} to true
set {_blockX} to X-location of block at loop-value set {_blockX} to X-location of block at loop-value
@ -100,12 +108,13 @@ every 0.5 second in "world": # pose du bloc et téléporatation
annonceParty("&a&l%{_player}%&r&e a réalisé un dé à coudre !") annonceParty("&a&l%{_player}%&r&e a réalisé un dé à coudre !")
else: else:
delete {thimble.dead.%uuid of loop-value%} delete {thimble.dead.%uuid of loop-value%}
# téléportation et feed/heal # téléportation et feed/heal
teleport loop-value to {thimble.location} teleport loop-value to {thimble.location}
feed loop-value feed loop-value
heal loop-value heal loop-value
# triggered if player die during a thimble game
on death: on death:
if {thimble} is true: if {thimble} is true:
if {party.player.%uuid of player%} is set: if {party.player.%uuid of player%} is set:

View file

@ -3,7 +3,9 @@ on load:
on unload: on unload:
ScriptList("remove", script) ScriptList("remove", script)
command sethome [<text>]: # défni un home # set a home
# the default home is "maison"
command sethome [<text>]:
executable by: players executable by: players
description: Défini un point de téléportation. description: Défini un point de téléportation.
trigger: trigger:
@ -23,7 +25,8 @@ command sethome [<text>]: # défni un home
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>]: # supprime un home # delete a home
command delhome [<text>]:
executable by: players executable by: players
description: Supprime un point de téléportation. description: Supprime un point de téléportation.
trigger: trigger:
@ -39,7 +42,8 @@ command delhome [<text>]: # supprime un home
send "&4Cette maison n'existe pas." send "&4Cette maison n'existe pas."
make player execute command "listhome" make player execute command "listhome"
command home [<text>]: # téléportation vers home # teleportation to a home
command home [<text>]:
executable by: players executable by: players
description: Te téléportes vers un point de téléportation. description: Te téléportes vers un point de téléportation.
trigger: trigger:
@ -54,13 +58,15 @@ command home [<text>]: # téléportation vers home
send "&4Le home ""&c%{_name}%"" &4n'existe pas." send "&4Le home ""&c%{_name}%"" &4n'existe pas."
make player execute command "listhome" make player execute command "listhome"
on tab complete for "home" and "delhome": # autocompletion des homes # autocompletion des homes
on tab complete for "home" and "delhome":
if {home.%player's uuid%::*} is set: if {home.%player's uuid%::*} is set:
set tab completions for position 1 to the first element of {home.%player's uuid%::*} set tab completions for position 1 to the first element of {home.%player's uuid%::*}
loop {home.%player's uuid%::*}: loop {home.%player's uuid%::*}:
add loop-value to tab completions add loop-value to tab completions
command listhome: # liste tes homes # list of homes
command listhome:
executable by: players executable by: players
description: Liste des tes points de téléportations. description: Liste des tes points de téléportations.
trigger: trigger:

View file

@ -1,5 +1,5 @@
options: options:
tailleInventaire: 41 # 36 d'inventaire + 4 d'équipement + 1 seconde main tailleInventaire: 41 # 36 inventory + 4 equipment + 1 second hand
messagePreChangement: "&7Changement d'inventaire..." messagePreChangement: "&7Changement d'inventaire..."
messagePostChargement: "&7&l%{_n1}%&7 objet%{_pluriel1}%&7 unique%{_pluriel1}%&7 sauvegardé%{_pluriel1}%&7 et &l%{_n2}%&7 objet%{_pluriel2}%&7 unique%{_pluriel2}%&7 chargé%{_pluriel2}%&7." messagePostChargement: "&7&l%{_n1}%&7 objet%{_pluriel1}%&7 unique%{_pluriel1}%&7 sauvegardé%{_pluriel1}%&7 et &l%{_n2}%&7 objet%{_pluriel2}%&7 unique%{_pluriel2}%&7 chargé%{_pluriel2}%&7."
@ -8,6 +8,8 @@ on load:
on unload: on unload:
ScriptList("remove", script) ScriptList("remove", script)
# allows to save the inventory of a player in a specific gamemode
# in the database and to return the number of saved items
function inventaire(mode: text, player: player, gamemode: text) :: number: function inventaire(mode: text, player: player, gamemode: text) :: number:
set {_uuid} to uuid of {_player} set {_uuid} to uuid of {_player}
set {_count} and {_nombreItems} to 0 set {_count} and {_nombreItems} to 0
@ -26,6 +28,7 @@ function inventaire(mode: text, player: player, gamemode: text) :: number:
add 1 to {_count} add 1 to {_count}
return {_nombreItems} return {_nombreItems}
# triggered when switching from/to survival gamemode
on gamemode change: on gamemode change:
if old gamemode of player is survival: if old gamemode of player is survival:
set {_n1} to inventaire("sauvegarde", player, "survival") set {_n1} to inventaire("sauvegarde", player, "survival")

74
main.sk
View file

@ -3,7 +3,8 @@ on load:
on unload: on unload:
ScriptList("remove", script) ScriptList("remove", script)
command skr [<text>]: # reload skript # macro for easy reload of scripts
command skr [<text>]:
executable by: players, console executable by: players, console
description: Reload de skripts. description: Reload de skripts.
trigger: trigger:
@ -12,16 +13,18 @@ command skr [<text>]: # reload skript
else if arg-1 isn't set: else if arg-1 isn't set:
execute player command "sk reload scripts" execute player command "sk reload scripts"
on tab complete for "skr": # autocompletion des homes # autocompletion for scripts
on tab complete for "skr":
set tab completions for position 1 to the first element of {scripts::*} set tab completions for position 1 to the first element of {scripts::*}
loop {scripts::*}: loop {scripts::*}:
add loop-value to tab completions add loop-value to tab completions
command broadcast [<text>]: # annonce # broadcast limited by a cooldown
command broadcast [<text>]:
executable by: players, console executable by: players, console
aliases: bc aliases: bc
description: Fais une annonce à tout le monde. (30s de cooldown) description: Fais une annonce à tout le monde. (30s de cooldown)
cooldown: 30 seconds cooldown: 30 seconds
cooldown message: &4Tu dois attendre &l%remaining time% &4pour refaire cette commande ! cooldown message: &4Tu dois attendre &l%remaining time% &4pour refaire cette commande !
trigger: trigger:
if player is op: if player is op:
@ -34,7 +37,8 @@ command broadcast [<text>]: # annonce
cancel command cooldown cancel command cooldown
send option("errorMessage") send option("errorMessage")
command skull [<offline player>]: # récupère la tête d'un joueur # retrieves a player's head
command skull [<offline player>]:
executable by: players executable by: players
aliases: head, tete aliases: head, tete
description: Te drop une tête d'un joueur. description: Te drop une tête d'un joueur.
@ -48,7 +52,8 @@ command skull [<offline player>]: # récupère la tête d'un joueur
else: else:
send option("errorMessage") send option("errorMessage")
command clearchat: # supprime l'historique du tchat # delete chat history
command clearchat:
executable by: players, console executable by: players, console
aliases: cc aliases: cc
description: Efface l'historique du chat dans ton monde. (1mn de cooldown) description: Efface l'historique du chat dans ton monde. (1mn de cooldown)
@ -65,10 +70,12 @@ command clearchat: # supprime l'historique du tchat
cancel command cooldown cancel command cooldown
send option("errorMessage") send option("errorMessage")
on weather change to rain or thunder: # soleil pour toujours # remove the rain in the server
on weather change to rain or thunder:
cancel event cancel event
command rename <text>: # renomme l'item dans la main du joueur # renames the item in the player's hand
command rename <text>:
executable by: players executable by: players
description: Renomme l'item que tu as dans ta main. description: Renomme l'item que tu as dans ta main.
trigger: trigger:
@ -83,14 +90,16 @@ command rename <text>: # renomme l'item dans la main du joueur
else: else:
send option("errorMessage") send option("errorMessage")
command afk: # annonce d'afk # afk announcement
command afk:
executable by: players executable by: players
description: Annonce que tu vas afk. description: Annonce que tu vas afk.
trigger: trigger:
set {_player} to userOrNick(player) set {_player} to userOrNick(player)
broadcast "&a%{_player}%&c est désormais afk !" in all worlds broadcast "&a%{_player}%&c est désormais afk !" in all worlds
command gmc [<player>]: # met un joueur en créatif # puts a player in creative
command gmc [<player>]:
executable by: players executable by: players
description: Change le mode de jeu d'un joueur en créatif. description: Change le mode de jeu d'un joueur en créatif.
trigger: trigger:
@ -107,7 +116,8 @@ command gmc [<player>]: # met un joueur en créatif
else: else:
send option("errorMessage") send option("errorMessage")
command gms [<player>]: # met un joueur en spectateur # puts a player as a spectator
command gms [<player>]:
executable by: players executable by: players
description: Change ton mode de jeu d'un joueur en spectateur description: Change ton mode de jeu d'un joueur en spectateur
trigger: trigger:
@ -124,7 +134,8 @@ command gms [<player>]: # met un joueur en spectateur
else: else:
send option("errorMessage") send option("errorMessage")
command top: # téléporte un joueur tout en haut # teleports a player to the highest point with a block under his feet
command top:
executable by: players executable by: players
description: Te téléporte sur le bloc le plus haut. description: Te téléporte sur le bloc le plus haut.
trigger: trigger:
@ -134,7 +145,9 @@ command top: # téléporte un joueur tout en haut
else: else:
send option("errorMessage") send option("errorMessage")
command killall: # tue toutes les entités sauf exeptions # kills all entities except exceptions (player, armor bearer, arrow,
# picture, frame, boat, villager and entity with a name)
command killall:
executable by: players executable by: players
description: Tue toutes les entités du monde sauf joueur, porte-armure, flèche, tableau, cadre, bateau, villageois et entité avec un nom. description: Tue toutes les entités du monde sauf joueur, porte-armure, flèche, tableau, cadre, bateau, villageois et entité avec un nom.
trigger: trigger:
@ -166,7 +179,8 @@ command killall: # tue toutes les entités sauf exeptions
else: else:
send option("errorMessage") send option("errorMessage")
command feed [<player>]: # remplie barre de nourriture d'un joueur # filled food bar of a player
command feed [<player>]:
executable by: players executable by: players
description: Remplie la barre de nourriture d'un joueur. description: Remplie la barre de nourriture d'un joueur.
trigger: trigger:
@ -184,21 +198,25 @@ command feed [<player>]: # remplie barre de nourriture d'un joueur
else: else:
send option("errorMessage") send option("errorMessage")
on first join: # premiere fois que le joueur rejoint le serveur # send message when player first join the server
on first join:
set join message to "&aC'est la première fois que l'on te vois &r%player%, &abienvenue !" set join message to "&aC'est la première fois que l'on te vois &r%player%, &abienvenue !"
on join: # joueur rejoint le serveur # message when joining server and change his motd if he not disabled the functionality
on join:
set {_player} to userOrNick(player) set {_player} to userOrNick(player)
set join message to "%{_player}% &aa rejoint le serveur !" set join message to "%{_player}% &aa rejoint le serveur !"
if {playerIP.%ip of player%} is not false: if {playerIP.%ip of player%} is not false:
set {playerIP.%ip of player%} to player set {playerIP.%ip of player%} to player
# message when leaving the serveur and removing his possible correspondent
on quit: on quit:
set {_player} to userOrNick(player) set {_player} to userOrNick(player)
set quit message to "%{_player}% &ca quitté le serveur !" # joueur quitte le serveur set quit message to "%{_player}% &ca quitté le serveur !" # joueur quitte le serveur
delete {dmReply.%uuid of player%} # suppression de la réponse delete {dmReply.%uuid of player%} # suppression de la réponse
command ip [<text>]: # information sur ip stocké # information on stored ip and ability to disable the functionality
command ip [<text>]:
executable by: players executable by: players
description: Information concernant ton IP et ce que collecte le serveur. description: Information concernant ton IP et ce que collecte le serveur.
trigger: trigger:
@ -221,7 +239,8 @@ command ip [<text>]: # information sur ip stocké
set {_inDB} to "non" if {playerIP.%ip of player%} is false set {_inDB} to "non" if {playerIP.%ip of player%} is false
send "&3Ton IP : &c%ip of player%&3 | Compte lié à l'IP : &c%{_inDB}%&3." send "&3Ton IP : &c%ip of player%&3 | Compte lié à l'IP : &c%{_inDB}%&3."
on server list ping: # motd # (sometimes custom) motd
on server list ping:
if {playerIP.%ip%} is set: if {playerIP.%ip%} is set:
if {playerIP.%ip%} is not false: if {playerIP.%ip%} is not false:
set {_motd} to "&e&k||| &cSalut &a%{playerIP.%ip%}%&c, reconnecte-toi ! &e&k|||" set {_motd} to "&e&k||| &cSalut &a%{playerIP.%ip%}%&c, reconnecte-toi ! &e&k|||"
@ -233,6 +252,8 @@ on server list ping: # motd
if max players count > {_playerCount}: if max players count > {_playerCount}:
set max players count to (number of all players + 1) set max players count to (number of all players + 1)
# show the nearest front block if functionality is enabled
# custom tab
every second: every second:
loop all players: loop all players:
# affiche le block proche de toi # affiche le block proche de toi
@ -240,7 +261,7 @@ every second:
loop all blocks in radius 3 of loop-player: loop all blocks in radius 3 of loop-player:
if loop-block is target block of loop-player: if loop-block is target block of loop-player:
set action bar of loop-player to "&a%target block of loop-player%" set action bar of loop-player to "&a%target block of loop-player%"
# tab # tab
set {_serverName} to option("serverName") set {_serverName} to option("serverName")
set {_numberOfConnectedPlayers} to number of all players set {_numberOfConnectedPlayers} to number of all players
@ -249,7 +270,8 @@ every second:
set {_player} to userOrNick(loop-player) set {_player} to userOrNick(loop-player)
set tab list name of loop-player to {_player} set tab list name of loop-player to {_player}
command quelbloc: # commande pour activer ou désactiver l'affiche du bloc proche de toi # command to activate or deactivate the display of the block near you
command quelbloc:
executable by: players executable by: players
description: T'affiches le bloc en face de toi. (switch off/on) description: T'affiches le bloc en face de toi. (switch off/on)
trigger: trigger:
@ -260,7 +282,8 @@ command quelbloc: # commande pour activer ou désactiver l'affiche du bloc proch
set {blockNear.%uuid of player%} to true set {blockNear.%uuid of player%} to true
send "&aTu verras désormais le nom du bloc proche de toi." send "&aTu verras désormais le nom du bloc proche de toi."
command casque: # met l'objet dans la main du joueur sur sa tête # places the item in the player's hand on his head
command casque:
executable by: players executable by: players
aliases: hat aliases: hat
description: Équipe l'objet dans ta main principale sur ta tête. description: Équipe l'objet dans ta main principale sur ta tête.
@ -282,7 +305,8 @@ command casque: # met l'objet dans la main du joueur sur sa tête
else: else:
send option("errorMessage") send option("errorMessage")
command clear [<player>]: # clear l'inventaire du joueur sauf équipement # clear the player's inventory except equipment
command clear [<player>]:
executable by: players executable by: players
description: Clear l'inventaire d'un joueur mais pas l'équipement. description: Clear l'inventaire d'un joueur mais pas l'équipement.
trigger: trigger:
@ -312,7 +336,8 @@ command clear [<player>]: # clear l'inventaire du joueur sauf équipement
else: else:
send option("errorMessage") send option("errorMessage")
command clearall [<player>]: # clear tout l'inventaire du joueur # clear all player inventory including equipment
command clearall [<player>]:
executable by: players executable by: players
aliases: fullclear aliases: fullclear
description: Clear tout l'inventaire d'un joueur. description: Clear tout l'inventaire d'un joueur.
@ -335,7 +360,8 @@ command clearall [<player>]: # clear tout l'inventaire du joueur
else: else:
send option("errorMessage") send option("errorMessage")
command couleur: # info sur les codes couleurs dans minecrafrt # info on color coding in minecraft
command couleur:
executable by: players executable by: players
aliases: couleurs, codecouleur, codecouleurs aliases: couleurs, codecouleur, codecouleurs
description: Informations sur le code des couleurs. description: Informations sur le code des couleurs.

View file

@ -6,12 +6,13 @@ on load:
on unload: on unload:
ScriptList("remove", script) ScriptList("remove", script)
command party [<player>] [<text>]: # commande party # commande party
command party [<player>] [<text>]:
executable by: players executable by: players
description: Regarde le nombre de joueur dans une partie ou invite un joueur dans ta partie. description: Regarde le nombre de joueur dans une partie ou invite un joueur dans ta partie.
trigger: trigger:
if arg-2 is set: if arg-2 is set:
if arg-2 is "join": # rejoindre la partie if arg-2 is "join": # join the party
if {party} is set: if {party} is set:
if {party.player.%uuid of player%} is set: if {party.player.%uuid of player%} is set:
send "&cTu es déjà dans la partie." send "&cTu es déjà dans la partie."
@ -26,7 +27,7 @@ command party [<player>] [<text>]: # commande party
else: else:
send {@pasDePartie} send {@pasDePartie}
stop stop
if arg-2 is "leave": if arg-2 is "leave": # leave the party
if {party} is set: if {party} is set:
if player is {party.creator}: if player is {party.creator}:
execute player command "party delete" execute player command "party delete"
@ -43,7 +44,7 @@ command party [<player>] [<text>]: # commande party
else: else:
send "&4Tu n'es pas dans la partie." send "&4Tu n'es pas dans la partie."
stop stop
if arg-2 is "create": if arg-2 is "create": # create a new party
if player is op: if player is op:
if {party} is set: if {party} is set:
set {_player} to userOrNick({party.creator}) set {_player} to userOrNick({party.creator})
@ -57,7 +58,7 @@ command party [<player>] [<text>]: # commande party
stop stop
else: else:
send option("errorMessage") send option("errorMessage")
if arg-2 is "delete": if arg-2 is "delete": # delete an owned party
if player is {party.creator}: if player is {party.creator}:
if {party} is set: if {party} is set:
if {thimble} is true: if {thimble} is true:
@ -74,14 +75,14 @@ command party [<player>] [<text>]: # commande party
else: else:
send option("errorMessage") send option("errorMessage")
stop stop
if arg-1 is set: if arg-1 is set: # invite a player to a party
if {party} is set: if {party} is set:
send "&aTu as invité &l%arg-1%&r&a." send "&aTu as invité &l%arg-1%&r&a."
set {_player} to userOrNick(player) set {_player} to userOrNick(player)
send formatted "<tooltip:&3Clique sur le message pour rejondre la partie.><cmd:/party join>&aVeux tu rejoindre la partie aux côtés de &9%{_player}%&a ?" to arg-1 send formatted "<tooltip:&3Clique sur le message pour rejondre la partie.><cmd:/party join>&aVeux tu rejoindre la partie aux côtés de &9%{_player}%&a ?" to arg-1
else: else:
send {@pasDePartie} send {@pasDePartie}
else: else: # info about the party
if {party} is set: if {party} is set:
set {_list} to "%{party.list::*}%" set {_list} to "%{party.list::*}%"
replace all "and" with "&7et&3" in {_list} replace all "and" with "&7et&3" in {_list}
@ -91,6 +92,7 @@ command party [<player>] [<text>]: # commande party
else: else:
send {@pasDePartie} send {@pasDePartie}
# triggered when leaving the server
on quit: on quit:
if {party.player.%uuid of player%} is set: if {party.player.%uuid of player%} is set:
if player is {party.creator}: if player is {party.creator}: