Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- prefix: &e&l[&6&l&oServeur&r&e&l]&r &e&l➤&r
- prefixwo: &e&l[&6&l&oServeur&r&e&l]&r
- error: &c&lErreur:&r
- noperm: &cVous n'avez pas la permission de faire cela !
- function JsonMessage(player: text, msg: text, tooltip: text, function: text, result: text):
- execute console command "/tellraw %{_player}% {""text"":""%{_msg}%"",""clickEvent"":{""action"":""%{_function}%"",""value"":""%{_result}%""},""hoverEvent"":{""action"":""show_text"",""value"":""%{_tooltip}%""}}"
- # Exemple : JsonMessage("%joueur%", "message", "infobulle", "type (=run_command; suggest_command...)", "command")
- # =====> Verifier si le temps est bien écris
- function CheckTime(time: text) :: boolean:
- if length of {_time} is 2:
- set {_check::*} to groups 0 of "%{_time}%" matched to "^[0-9](s|S|m|M|h|H|d|D)$"
- else if length of {_time} is 3:
- set {_check::*} to groups 0 of "%{_time}%" matched to "^[0-9]{2}(s|S|m|M|h|H|d|D)$"
- if {_check::*} is set:
- return true
- else:
- return false
- # =====> Retourner le temps en TimeSpan
- function TransformTime(time: text) :: timespan:
- if length of {_time} is 2:
- set {_time} to "0%{_time}%"
- set {_characters::*} to {_time} split at ""
- if {_characters::3} is "s":
- set {_characters::3} to " seconds"
- else if {_characters::3} is "m":
- set {_characters::3} to " minutes"
- else if {_characters::3} is "h":
- set {_characters::3} to " hours"
- else if {_characters::3} is "d":
- set {_characters::3} to " days"
- set {_result} to "%{_characters::1}%%{_characters::2}%%{_characters::3}%" parsed as timespan
- return {_result}
- # =====> Retourner le temps en temps normal
- function SanctionTime(time: timespan) :: text:
- set {_time} to "%{_time}%"
- set {_words::*} to {_time} split at " "
- if {_words::2} is "second" or "seconds":
- set {_words::2} to "seconde(s)"
- else if {_words::2} is "minute" or "minutes":
- set {_words::2} to "minute(s)"
- else if {_words::2} is "hour" or "hours":
- set {_words::2} to "heure(s)"
- else if {_words::2} is "day" or "days":
- set {_words::2} to "jour(s)"
- set {_result} to "%{_words::1}% %{_words::2}%"
- return {_result}
- # =====> Retourner le temps restant d'une sanction
- function TimeLeft(difference: timespan, cooldown: timespan) :: text:
- subtract {_difference} from {_cooldown}
- set {_cooldown} to "%{_cooldown}%"
- replace "second" with "seconde" in {_cooldown}
- replace "minute" with "minute" in {_cooldown}
- replace "hour" with "heure" in {_cooldown}
- replace "day" with "jour" in {_cooldown}
- replace "and" with "et" in {_cooldown}
- set {_words::*} to {_cooldown} split at " "
- if {_words::5} is set:
- set {_words::1} to rounded down ("%{_words::1}%" parsed as number)
- set {_words::4} to rounded down ("%{_words::4}%" parsed as number)
- set {_result} to "%{_words::1}% %{_words::2}% %{_words::3}% %{_words::4}% %{_words::5}%"
- else:
- set {_words::1} to rounded down ("%{_words::1}%" parsed as number)
- set {_result} to "%{_words::1}% %{_words::2}%"
- return {_result}
- command /ban [<offline player>] [<text>]:
- aliases: permban
- trigger:
- if player has permission "mod.ban":
- if arg-1 is set:
- if {mod::ban::%arg-1%::isBan} is true:
- message "{@prefix} {@error} &c%arg-1% &cest déjà banni !"
- else:
- if arg-1 has permission "mod.banExempt":
- message "{@prefix} {@error} &cVous ne pouvez pas bannir %arg-1%"
- else:
- if arg-2 is set:
- set {mod::ban::%arg-1%::reason} to arg-2
- else:
- set {mod::ban::%arg-1%::reason} to "Vous avez été banni !"
- set {mod::ban::%arg-1%::isBan} to true
- set {mod::ban::%arg-1%::time} to "Jamais"
- set {mod::ban::%arg-1%::start} to now
- set {mod::ban::%arg-1%::executor} to "%player%"
- add arg 1 to {ban::playerList::*}
- kick arg-1 due to "{@prefixwo}%nl%&b%nl%&cVous avez été banni !%nl%&b%nl%&cBanni par: &6%{mod::ban::%arg-1%::executor}%%nl%&cRaison: &6%{mod::ban::%arg-1%::reason}%%nl%&cDurée: &6Permanant"
- broadcast "{@prefix} &c%arg-1% &7à été bannis par &c%player% &7pour &c%{mod::ban::%arg-1%::reason}% &7pendant : &cPermanant"
- else:
- message "{@prefix} {@error} &cUsage : /ban <joueur> <raison>"
- else:
- message "{@prefix} {@error} {@noperm}"
- command /tempban [<offline player>] [<text>] [<text>]:
- trigger:
- if player has permission "mod.tempban":
- if arg-1 is set:
- if {mod::ban::%arg-1%::isBan} is true:
- message "{@prefix} {@error} &c%arg-1% &cest déjà banni !"
- else:
- if arg-1 has permission "mod.tempbanExempt":
- message "{@prefix} {@error} &cVous ne pouvez pas bannir %arg-1%"
- else:
- if CheckTime(arg 2) is false:
- send "{@prefix} {@error} &cLa durée n'a pas été écrite correctement ! &7&oEx pour 1 jour: 1d"
- else:
- if arg-3 is set:
- set {mod::ban::%arg-1%::reason} to arg-3
- else:
- set {mod::ban::%arg-1%::reason} to "Vous avez été banni temporairement!"
- set {mod::ban::%arg-1%::isBan} to true
- set {mod::ban::%arg-1%::time} to TransformTime(arg 2)
- set {mod::ban::%arg-1%::start} to now
- set {mod::ban::%arg-1%::executor} to "%player%"
- add arg 1 to {ban::playerList::*}
- set {_time} to SanctionTime({mod::ban::%arg-1%::time})
- kick arg-1 due to "{@prefixwo}%nl%&b%nl%&cVous avez été banni !%nl%&b%nl%&cBanni par: &6%{mod::ban::%arg-1%::executor}%%nl%&cRaison: &6%{mod::ban::%arg-1%::reason}%%nl%&cDurée: &6%{_time}%"
- broadcast "{@prefix} &c%arg-1% &7à été bannis par &c%player% &7pour &c%{mod::ban::%arg-1%::reason}% &7pendant : &c%{_time}%"
- else:
- message "{@prefix} {@error} &cUsage : /tempban <joueur> <temps> <raison>"
- else:
- message "{@prefix} {@error} {@noperm}"
- command /unban [<offline player>]:
- trigger:
- if player has permission "mod.unban":
- if arg-1 is set:
- if {mod::ban::%arg-1%::isBan} is not true:
- message "{@prefix} {@error} &c%arg-1% &cn'est pas banni !"
- else:
- clear {mod::ban::%arg-1%::*}
- clear {mod::ban::%arg-1%}
- remove arg-1 from {ban::playerList::*}
- broadcast "{@prefix} &c%arg-1% &7à été unban par &c%player%&7."
- else:
- message "{@prefix} {@error} &cUsage : /unban <joueur>"
- else:
- message "{@prefix} {@error} {@noperm}"
- on connect:
- if {mod::ban::%player%::isBan} is true:
- if {mod::ban::%player%::time} is "Jamais":
- kick player due to "{@prefixwo}%nl%&b%nl%&cVous avez été banni !%nl%&b%nl%&cBanni par: &6%{mod::ban::%player%::executor}%%nl%&cRaison: &6%{mod::ban::%player%::reason}%%nl%&cDurée: &6Permanant"
- else:
- if difference between {mod::ban::%player%::start} and now is less than {mod::ban::%player%::time}:
- wait a tick
- set {_timeleft} to TimeLeft(difference between {mod::ban::%player%::start} and now, {mod::ban::%player%::time})
- kick player due to "{@prefixwo}%nl%&b%nl%&cVous avez été banni !%nl%&b%nl%&cBanni par: &6%{mod::ban::%player%::executor}%%nl%&cRaison: &6%{mod::ban::%player%::reason}%%nl%&cTemps restant : %{_timeleft}%"
- else:
- clear {mod::ban::%player%}
- remove player from {ban::playerList::*}
Advertisement
Add Comment
Please, Sign In to add comment