skriptMC/0functions.sk

33 lines
1.1 KiB
Text
Raw Normal View History

2021-06-28 21:50:46 +02:00
# named with a 0 at the begining to be sure he is load first
on load:
ScriptList("add", script)
on unload:
ScriptList("remove", script)
2021-06-28 12:04:45 +02:00
function option(option: text) :: text: # options
if {_option} is "serverName":
set {_resultat} to "Serveur d'Anri"
if {_option} is "errorMessage":
set {_resultat} to "&4Tu n'as pas la permission d'utiliser cette commande."
return {_resultat}
2021-06-28 12:04:45 +02:00
function sendToOperators(player: player, message: text): # envoie message aux opérateurs (exclu le player s'il est OP aussi)
loop all players:
if loop-player is a op:
if loop-player is not {_player}:
send {_message} to loop-player
2021-06-28 21:50:46 +02:00
function ScriptList(addRemove: text, list: text):
if {_addRemove} is "add":
add {_list} to {scripts::*}
if {_addRemove} is "remove":
remove {_list} from {scripts::*}
2021-06-29 21:07:16 +02:00
function userOrNick(player: player) :: text:
set {_uuid} to uuid of {_player}
if {nick.%{_uuid}%} is set:
2021-06-29 22:09:02 +02:00
set {_res} to "%{nick.%{_uuid}%}%&7 (%{_player}%)"
2021-06-29 21:07:16 +02:00
else:
2021-06-29 22:09:02 +02:00
set {_res} to "%{_player}%"
2021-06-29 21:07:16 +02:00
return {_res}