[spoiler=code]
options:
cmd_point: /point
start: 0
page_size: 8
noPermissionMessage: &cTu n'as pas la permission de faire cela !
first join:
if {point::%uuid of player%} is not set:
execute console command "{@cmd_point} create %player%"
else:
if "%{point::%uuid of player%}%" is not "%player%":
set {point::%uuid of player%} to "%player%"
send "§bTransfert de votre ancien compte bancaire." to player
join:
if {point::%uuid of player%} is not set:
execute console command "{@cmd_point} create %player%"
else:
if "%{point::%uuid of player%}%" is not "%player%":
set {point::%uuid of player%} to "%player%"
send "§bTransfert de votre ancien compte bancaire." to player
command {@cmd_point} [<text>] [<text>] [<text>]:
trigger:
if argument 1 is "help" or "h" or "?":
if argument 2 parsed as number is set:
add "§b{@cmd_point} h,help,?§3 [page=1]§f affiche l'aide" to {_commands::*}
add "§b{@cmd_point} create§3 <uuid>§f créer un compte." to {_commands::*}
add "§b{@cmd_point} del,delete§3 <uuid>§f supprimer un compte." to {_commands::*}
add "§b{@cmd_point} give/take/set§3 <uuid> <amount>§f faire varier le montant d'un compte." to {_commands::*}
add "§b{@cmd_point}§3 <uuid=you>§f voir l'argent d'un joueur." to {_commands::*}
add "§b{@cmd_point} top§3 [page=1]§f voir le classement." to {_commands::*}
if argument 2 parsed as number is bigger than 0:
if argument 2 parsed as number is smaller or equal to rounded up (size of {_commands::*} / {@page_size}):
send "§8§m-------------------------%nl%§8Page %argument 2 parsed as number%/%rounded up (size of {_commands::*} / {@page_size})%" to sender
loop {_commands::*}:
send "%loop-value%" to sender
send "§8§m-------------------------" to sender
else:
send "§cErreur: La page demandée n'a pas pu être affichée." to sender
else:
send "§cErreur: La page demandée n'a pas pu être affichée." to sender
else:
execute sender command "{@cmd_point} ? 1"
else if argument 1 is "create":
if player has permission "use.create":
if argument 2 parsed as player is set:
execute sender command "{@cmd_point} create %uuid of argument 2 parsed as player%"
else if argument 2 is set:
loop all players:
if "%uuid of loop-player%" is "%argument 2%":
set {_found} to "%loop-player%"
exit loop
if {_found} is set:
if {point::%argument 2%} is not set:
set {point::%argument 2%} to "%{_found}%"
if {point::%argument 2%::value} is not set:
set {point::%argument 2%::value} to {@start}
send "§bCréation du compte:§3 %{_found}% --> {@start}$%nl%§bChemin d'accès:§f %argument 2%" to sender and "%{_found}%" parsed as player
else:
send "§cErreur: Ce compte existe déjà." to sender
else:
send "§cErreur: Aucun joueur connecté n'est associé à cet UUID." to sender
else:
send "§cErreur: {@cmd_point} h,help,? [page=1] pour afficher l'aide." to sender
else:
send "§cErreur: {@noPermissionMessage}"
else if argument 1 is "del" or "delete":
if player has permission "use.delete":
if argument 2 is set:
if "%argument 2%" parsed as offline player is online:
if {point::%uuid of argument 2 parsed as offline player%} is set:
clear {point::%uuid of argument 2 parsed as offline player%::value}
clear {point::%uuid of argument 2 parsed as offline player%}
send "§bSuppression du compte bancaire§3 %argument 2%§b effecutée.%nl%§bAncien chemin:§f %uuid of argument 2 parsed as offline player%" to sender and argument 2 parsed as offline player
else:
send "§cErreur: Ce compte bancaire n'existe pas." to sender
else:
loop {point::*}:
if "%loop-value%" is "%argument 2 parsed as offline player%":
set {_found} to "%loop-index%"
exit loop
if {_found} is set:
clear {point::%uuid of argument 2 parsed as offline player%::value}
clear {point::%uuid of argument 2 parsed as offline player%}
send "§bSuppression du compte bancaire§3 %argument 2%§b effecutée.%nl%§bAncien chemin:§f %uuid of argument 2 parsed as offline player%" to sender
else:
send "§cErreur: Ce compte bancaire n'existe pas." to sender
else:
send "§cErreur: {@cmd_point} h,help,? [page=1] pour afficher l'aide." to sender
else:
send "§cErreur: {@noPermissionMessage}"
else if argument 1 is "take" or "give" or "set":
if player has permission "use.give" or "use.take" or "use.set":
if argument 2 is set:
if argument 3 parsed as number is set:
loop {point::*}:
if "%loop-value%" is "%argument 2 parsed as offline player%":
set {_found} to "%loop-index%"
exit loop
if {_found} is set:
if argument 1 is "take":
if player has permission "use.take":
if {point::%uuid of argument 2 parsed as offline player%::value} is bigger or equal to argument 3 parsed as number:
set {_point} to argument 3 parsed as number * -1
else:
send "§cErreur: {@noPermissionMessage}"
stop
else if argument 1 is "give":
if player has permission "use.give":
set {_point} to argument 3 parsed as number
else:
send "§cErreur: {@noPermissionMessage}"
stop
if argument 1 is "take" or "give":
if "%sender%" is not "%argument 2%":
send "§bNouveau montant du joueur§3 %argument 2%§b:§3 %{point::%uuid of argument 2 parsed as offline player%::value} + {_point}%$%nl%§f%{_point}%$" to sender and argument 2 parsed as player
else:
send "§bNouveau montant du joueur§3 %argument 2%§b:§3 %{point::%uuid of argument 2 parsed as offline player%::value} + {_point}%$%nl%§f%{_point}%$" to sender
set {point::%uuid of argument 2 parsed as offline player%::value} to {point::%uuid of argument 2 parsed as offline player%::value} + {_point}
else if argument 3 parsed as number is bigger or equal to 0:
if player has permission "use.set":
if "%sender%" is not "%argument 2%":
send "§bNouveau montant du joueur§3 %argument 2%§b:§3 %argument 3 parsed as number%$" to sender and argument 2 parsed as player
else:
send "§bNouveau montant du joueur§3 %argument 2%§b:§3 %argument 3 parsed as number%$" to sender
set {point::%uuid of argument 2 parsed as offline player%::value} to argument 3 parsed as number
else:
send "§cErreur: {@noPermissionMessage}"
stop
else:
send "§cErreur: Un compte bancaire ne peut être négatif." to sender
else:
send "§cErreur: Ce compte bancaire n'existe pas." to sender
else:
send "§cErreur: {@cmd_point} h,help,? [page=1] pour afficher l'aide." to sender
else:
send "§cErreur: {@cmd_point} h,help,? [page=1] pour afficher l'aide." to sender
else:
send "§cErreur: {@noPermissionMessage}"
else if argument 1 is "top":
if argument 2 parsed as number is set:
if argument 2 parsed as number is bigger than 0:
if argument 2 parsed as number is smaller or equal to rounded up (size of {point::*} / {@page_size}):
loop {point::*}:
set {_liste::%loop-value%} to {point::%loop-index%::value}
while size of {_liste::*} is not 0:
loop {_liste::*}:
if {_max} is not set:
set {_max} to loop-value
set {_index} to loop-index
else if loop-value is bigger or equal to {_max}:
set {_max} to loop-value
set {_index} to loop-index
clear {_liste::%{_index}%}
add {_max} to {_value::*}
add {_index} to {_account::*}
do [clear {_max}]->[clear {_index}]
set {_index} to 0
send "§8§m-------------------------%nl%§8Page %argument 2 parsed as number%/%rounded up (size of {point::*} / {@page_size})%" to sender
loop size of {point::*} times:
if {_index} >= argument 2 parsed as number * {@page_size} - {@page_size}:
if {_index} < argument 2 parsed as number * {@page_size}:
set {_checked} to {_index} + 1
send "§b##%{_checked}% - %{_account::%{_checked}%}%:§f %{_value::%{_checked}%}%" to sender
else:
exit loop
add 1 to {_index}
send "§8§m-------------------------" to sender
else:
send "§cErreur: La page demandée n'a pas pu être affichée." to sender
else:
send "§cErreur: La page demandée n'a pas pu être affichée." to sender
else:
execute sender command "{@cmd_point} %argument 1% 1"
else if argument 1 is not set:
execute sender command "{@cmd_point} %player%"
else:
loop {point::*}:
if "%{point::%uuid of argument 1 parsed as offline player%}%" is "%argument 1%":
set {_found} to loop-index
exit loop
if {_found} is set:
send "§bPoint de§3 %argument 1%§b:§f %{point::%uuid of argument 1 parsed as offline player%::value}%" to sender
else:
send "§cErreur: Ce compte bancaire n'existe pas." to sender
voila ^^
j'ai mis la permission "use.give" sur le /point give ; "use.take" sur le /point take ; "use.set" sur le /point set ; "use.delete" sur le /point del et "use.create" sur le /point create. Je ne vais pas t'expliquer comment j'ai fait pour le /point give/set/take parce que la façon dont c'est codé (c'est très bien codé, mais pas très bien organisé) a un peu "compliquer" la tâche. Mais regarde sur le /point delete. Juste après avoir vérifier si il avait fait /point delete, je regarde si il a la permission nécessaire, avec cette condition:
if player has permission "use.delete":
et si il ne l'a pas, je lui dis qu'il n'a pas la permission, avec ces lignes:
else: # sinon
send "§cErreur: {@noPermissionMessage}" # Je lui dis qu'il n'a pas la perm
et voila :p
Tu peux customiser le message de non-permission tout en haut du script, dans les options !
Donc si je t'ai aidé, passe en résolu :)