using userOrNick function everywhere

This commit is contained in:
Mylloon 2021-06-29 22:09:02 +02:00
parent f6deddbb34
commit 10079ea8d0
4 changed files with 47 additions and 21 deletions

View file

@ -26,7 +26,7 @@ function ScriptList(addRemove: text, list: text):
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:
set {_res} to {nick.%{_uuid}%} set {_res} to "%{nick.%{_uuid}%}%&7 (%{_player}%)"
else: else:
set {_res} to name of {_player} set {_res} to "%{_player}%"
return {_res} return {_res}

View file

@ -6,7 +6,7 @@ on unload:
on chat: # chat on chat: # chat
cancel event cancel event
set {_player} to userOrNick(player) set {_player} to userOrNick(player)
broadcast "<%{_player}%&r> %colored message%" in world of player broadcast "%{_player}%&r &8➡&r %colored message%" in world of player
command nickname [<player>] [<text>]: # changement de pseudo command nickname [<player>] [<text>]: # changement de pseudo
executable by: players executable by: players

View file

@ -94,7 +94,7 @@ every 0.5 second in "world": # pose du bloc et téléporatation
if {thimble.dead.%uuid of loop-value%} is not set: if {thimble.dead.%uuid of loop-value%} is not set:
if {_niceJump} is true: if {_niceJump} is true:
set block at loop-value to gold block set block at loop-value to gold block
set {_player} to loop-value set {_player} to userOrNick(loop-value)
loop {party.list::*}: loop {party.list::*}:
send "&a&l%{_player}%&r&e a fait un beau jump !" to loop-value-2 send "&a&l%{_player}%&r&e a fait un beau jump !" to loop-value-2
else: else:
@ -115,14 +115,16 @@ on death:
set {thimble.dead.%uuid of player%} to true set {thimble.dead.%uuid of player%} to true
set {_finPartie} to 0 set {_finPartie} to 0
loop {party.list::*}: loop {party.list::*}:
if {thimble.dead.%uuid of loop-value%} is false: if {thimble.dead.%uuid of loop-value%} is not set:
set {_gagnant} to loop-value set {_gagnant} to userOrNick(loop-value)
add 1 to {_finPartie} add 1 to {_finPartie}
send "&c%player%&b a été éliminé !" to loop-value else:
set {_player} to userOrNick(loop-value)
send "&c%{_player}%&b a été éliminé !" to loop-value
if {_finPartie} is 1 or 0: if {_finPartie} is 1 or 0:
loop {party.list::*}: loop {party.list::*}:
if {_gagnant} is set: if {_gagnant} is set:
send "&a&l%{_gagnant}%&r&l a gagné la partie !!" to loop-value send "&a&l%{_gagnant}%&r&l a gagné la partie !!" to loop-value
else: else:
send "&cTu était tout seul à jouer... bravo quand même ?" to loop-value send "&cTu étais tout seul à jouer... bravo quand même ?" to loop-value
execute player command "deacoudre" execute player command "deacoudre"

50
main.sk
View file

@ -56,9 +56,10 @@ command clearchat: # supprime l'historique du tchat
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:
set {_player} to userOrNick(player)
loop 98 times: loop 98 times:
broadcast " " in world of player broadcast " " in world of player
broadcast "&cLe Chat a été clear par &e%player%&c." in world of player broadcast "&cLe Chat a été clear par &e%{_player}%&c." in world of player
broadcast " " in world of player broadcast " " in world of player
else: else:
cancel command cooldown cancel command cooldown
@ -86,7 +87,8 @@ command afk: # annonce d'afk
executable by: players executable by: players
description: Annonce que tu vas afk. description: Annonce que tu vas afk.
trigger: trigger:
broadcast "&a%player's name%&c est désormais afk !" in world of player set {_player} to userOrNick(player)
broadcast "&a%{_player}%&c est désormais afk !" in world of player
command gmc [<player>]: # met un joueur en créatif command gmc [<player>]: # met un joueur en créatif
executable by: players executable by: players
@ -100,7 +102,7 @@ command gmc [<player>]: # met un joueur en créatif
send "&4Ce joueur est déjà en créatif." send "&4Ce joueur est déjà en créatif."
stop stop
set gamemode of {_player} to creative set gamemode of {_player} to creative
send "%player% a changé ton mode de jeu en créatif." to {_player} send "&7%player%&7 a changé ton mode de jeu en créatif." to {_player}
sendToOperators({_player}, "&7&o%player%&7&o a changé le mode de jeu de %{_player}%&7&o en créatif.") sendToOperators({_player}, "&7&o%player%&7&o a changé le mode de jeu de %{_player}%&7&o en créatif.")
else: else:
send option("errorMessage") send option("errorMessage")
@ -117,7 +119,7 @@ command gms [<player>]: # met un joueur en spectateur
send "&4Ce joueur est déjà en spectateur." send "&4Ce joueur est déjà en spectateur."
stop stop
set gamemode of {_player} to spectator set gamemode of {_player} to spectator
send "%player% a changé ton mode de jeu en spectateur." to {_player} send "&7%player%&7 a changé ton mode de jeu en spectateur." to {_player}
sendToOperators({_player}, "&7&o%player%&7&o a changé le mode de jeu de %{_player}%&7&o en spectateur.") sendToOperators({_player}, "&7&o%player%&7&o a changé le mode de jeu de %{_player}%&7&o en spectateur.")
else: else:
send option("errorMessage") send option("errorMessage")
@ -128,6 +130,7 @@ command top: # téléporte un joueur tout en haut
trigger: trigger:
if player is op: if player is op:
teleport player to location of highest block at location teleport player to location of highest block at location
send "&aTu as été téléporté !"
else: else:
send option("errorMessage") send option("errorMessage")
@ -158,7 +161,8 @@ command killall: # tue toutes les entités sauf exeptions
kill loop-entity kill loop-entity
add 1 to {_count} add 1 to {_count}
send "Tu as tué %{_count}% entités." send "Tu as tué %{_count}% entités."
sendToOperators(player, "&7%player%&7 as tué %{_count}%&7 entités.") set {_player} to userOrNick(player)
sendToOperators(player, "&7%{_player}%&7 as tué %{_count}%&7 entités.")
else: else:
send option("errorMessage") send option("errorMessage")
@ -241,10 +245,7 @@ every 1 second in "world":
set {_pluriel} to "" set {_pluriel} to ""
set {_pluriel} to "s" if {_numberOfConnectedPlayers} > 1 set {_pluriel} to "s" if {_numberOfConnectedPlayers} > 1
set tab header to "&a%{_serverName}%" and footer to "&e%{_numberOfConnectedPlayers}% joueur%{_pluriel}% connecté%{_pluriel}%\n&9%ping of loop-player% ms de latence" for loop-player set tab header to "&a%{_serverName}%" and footer to "&e%{_numberOfConnectedPlayers}% joueur%{_pluriel}% connecté%{_pluriel}%\n&9%ping of loop-player% ms de latence" for loop-player
if {nick.%uuid of loop-player%} is set: set {_player} to userOrNick(loop-player)
set {_player} to "%{nick.%uuid of loop-player%}%&7 (%loop-player%)"
else:
set {_player} to "%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 quelbloc: # commande pour activer ou désactiver l'affiche du bloc proche de toi
@ -301,8 +302,10 @@ command clear [<player>]: # clear l'inventaire du joueur sauf équipement
set leggings of {_player} to {_leggings} set leggings of {_player} to {_leggings}
set boots of {_player} to {_boots} set boots of {_player} to {_boots}
if {_arg1} is set: if {_arg1} is set:
send "&aTu as clear l'inventaire de %arg-1%&a." set {_player} to userOrNick(arg-1)
send "&aTon inventaire a été clear par %player%&a." to arg-1 send "&aTu as clear l'inventaire de %{_player}%&a."
set {_player} to userOrNick(player)
send "&aTon inventaire a été clear par %{_player}%&a." to arg-1
else: else:
send "&aTu as clear ton inventaire." send "&aTu as clear ton inventaire."
else: else:
@ -322,9 +325,30 @@ command clearall [<player>]: # clear tout l'inventaire du joueur
set {_player} to arg-1 set {_player} to arg-1
clear {_player}'s inventory clear {_player}'s inventory
if {_arg1} is set: if {_arg1} is set:
send "&aTu as clear l'inventaire de %arg-1%&a." set {_player} to userOrNick(arg-1)
send "&aTon inventaire a été clear par %player%&a." to arg-1 send "&aTu as clear l'inventaire de %{_player}%&a."
set {_player} to userOrNick(player)
send "&aTon inventaire a été clear par %{_player}%&a." to arg-1
else: else:
send "&aTu as clear ton inventaire." send "&aTu as clear ton inventaire."
else: else:
send option("errorMessage") send option("errorMessage")
command couleur: # info sur les codes couleurs dans minecrafrt
executable by: players
aliases: couleurs, codecouleur, codecouleurs
description: Informations sur le code des couleurs.
trigger:
send "&lMettre & ou § au début du code pour faire une couleur"
send ""
send "4 ➡ &4Rouge foncé&r d ➡ &dViolet"
send "c ➡ &cRouge&r 5 ➡ &5Violet foncé"
send "6 ➡ &6Or&r f ➡ &fBlanc"
send "e ➡ &eJaune&r 7 ➡ &7Gris"
send "2 ➡ &2Vert foncé&r 8 ➡ &8Gris foncé"
send "a ➡ &aVert&r 0 ➡ &0Noir"
send "3 ➡ &3Bleu marine&r l ➡ &lGras"
send "1 ➡ &1Bleu foncé&r o ➡ &oItalique"
send "9 ➡ &9Ble&r n ➡ &nSouligné"
send "k ➡ Glitché (exemple : &ka0\|&r) m ➡ &mBarré"
send "b ➡ &bBleu ciel&r r ➡ &rRéinitialise la couleur et style"