Aller au contenu

Classement


Contenu populaire

Affichage du contenu avec la meilleure réputation le 01/28/18 dans toutes les zones

  1. 1 point
    J'ai fais cela toute à l'heure ca peut t'intéresser, surement:[spoiler=Code] options: cmd_money: /money start: 30 page_size: 8 first join: if {money::%uuid of player%} is not set: execute console command "{@cmd_money} create %player%" else: if "%{money::%uuid of player%}%" is not "%player%": set {money::%uuid of player%} to "%player%" send "§bTransfert de votre ancien compte bancaire." to player join: if {money::%uuid of player%} is not set: execute console command "{@cmd_money} create %player%" else: if "%{money::%uuid of player%}%" is not "%player%": set {money::%uuid of player%} to "%player%" send "§bTransfert de votre ancien compte bancaire." to player command {@cmd_money} [<text>] [<text>] [<text>]: trigger: if argument 1 is "help" or "h" or "?": if argument 2 parsed as number is set: add "§b{@cmd_money} h,help,?§3 [page=1]§f affiche l'aide" to {_commands::*} add "§b{@cmd_money} create§3 <uuid>§f créer un compte." to {_commands::*} add "§b{@cmd_money} del,delete§3 <uuid>§f supprimer un compte." to {_commands::*} add "§b{@cmd_money} give/take/set§3 <uuid> <amount>§f faire varier le montant d'un compte." to {_commands::*} add "§b{@cmd_money}§3 <uuid=you>§f voir l'argent d'un joueur." to {_commands::*} add "§b{@cmd_money} 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_money} ? 1" else if argument 1 is "create": if argument 2 parsed as player is set: execute sender command "{@cmd_money} 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 {money::%argument 2%} is not set: set {money::%argument 2%} to "%{_found}%" if {money::%argument 2%::value} is not set: set {money::%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 bancaire existe déjà." to sender else: send "§cErreur: Aucun joueur connecté n'est associé à cet UUID." to sender else: send "§cErreur: {@cmd_money} h,help,? [page=1] pour afficher l'aide." to sender else if argument 1 is "del" or "delete": if argument 2 is set: if "%argument 2%" parsed as offline player is online: if {money::%uuid of argument 2 parsed as offline player%} is set: clear {money::%uuid of argument 2 parsed as offline player%::value} clear {money::%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 {money::*}: if "%loop-value%" is "%argument 2 parsed as offline player%": set {_found} to "%loop-index%" exit loop if {_found} is set: clear {money::%uuid of argument 2 parsed as offline player%::value} clear {money::%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_money} h,help,? [page=1] pour afficher l'aide." to sender else if argument 1 is "take" or "give" or "set": if argument 2 is set: if argument 3 parsed as number is set: loop {money::*}: 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 {money::%uuid of argument 2 parsed as offline player%::value} is bigger or equal to argument 3 parsed as number: set {_money} to argument 3 parsed as number * -1 else if argument 1 is "give": set {_money} to argument 3 parsed as number if argument 1 is "take" or "give": if "%sender%" is not "%argument 2%": send "§bNouveau montant du joueur§3 %argument 2%§b:§3 %{money::%uuid of argument 2 parsed as offline player%::value} + {_money}%$%nl%§f%{_money}%$" to sender and argument 2 parsed as player else: send "§bNouveau montant du joueur§3 %argument 2%§b:§3 %{money::%uuid of argument 2 parsed as offline player%::value} + {_money}%$%nl%§f%{_money}%$" to sender set {money::%uuid of argument 2 parsed as offline player%::value} to {money::%uuid of argument 2 parsed as offline player%::value} + {_money} else if argument 3 parsed as number is bigger or equal to 0: 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 {money::%uuid of argument 2 parsed as offline player%::value} to argument 3 parsed as number 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_money} h,help,? [page=1] pour afficher l'aide." to sender else: send "§cErreur: {@cmd_money} h,help,? [page=1] pour afficher l'aide." to sender 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 {money::*} / {@page_size}): loop {money::*}: set {_liste::%loop-value%} to {money::%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 {money::*} / {@page_size})%" to sender loop size of {money::*} 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_money} %argument 1% 1" else if argument 1 is not set: execute sender command "{@cmd_money} %player%" else: loop {money::*}: if "%{money::%uuid of argument 1 parsed as offline player%}%" is "%argument 1%": set {_found} to loop-index exit loop if {_found} is set: send "§bArgent de§3 %argument 1%§b:§f %{money::%uuid of argument 1 parsed as offline player%::value}%$" to sender else: send "§cErreur: Ce compte bancaire n'existe pas." to sender Code testé et fonctionnel, bonne journée.
×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.