Aller au contenu

Messages recommandés

Posté(e)

Version skript: 1.8.x

Type du skript: PvP

Bonsoir je viens ici pour vous demander l'aide d'un "mini-skript" enfait j'aimerais créer une commande spéciale: /duel.

 

Commandes:

/duel

 

Permissions:

- aucune particulières

 

Principe du skript:

Lorsque la commande "/duel" est effectuée, ça ouvre un inventaire au joueur, sauf que dans cet inventaire, je voudrais qu'il y'ait toutes les têtes des joueurs connectés sur le serveur et que lorsque le joueur clique sur une tête et bien ça check la tete de x joueur et donc ca demande le joueur x en duel. Et j'aimerais aussi que lors de l'ouverture de l'inventaire, le nombre de ligne de l'inventaire se fasse automatiquement en fonction du nombre de joueurs connectés, c'est à dire que si il y a moins de 9 joueurs de co pas besoin de 3 lignes, une seule suffit mais si il y en a plus de 35-36 il faudrait une "page 2" qui ouvre un autre inventaire avec le reste des joueurs. J'espère avoir été clair :) En attente d'une aide certaine !

 

Cordialement, iSkix

Posté(e)

Salut je vais te faire ça :)

-----

J'ai essayer dit moi si il y a des erreurs, (Il faudra modifier la ligne 35 pour lancer le duel)

 

command /duel [<player>]:
   trigger:
       if arg 1 is not set:
           loop all players:
               if loop-value is not player:
                   add loop-value to {_duel.list::*}
           set {_nb} to size of {_duel.list::*}
           if {_nb} is between 1 and 9:
               set {_row} to 1
           else if {_nb} is between 10 and 18:
               set {_row} to 2
           else if {_nb} is between 19 and 27:
               set {_row} to 3
           else if {_nb} is between 28 and 36:
               set {_row} to 4
           else if {_nb} is between 37 and 45:
               set {_row} to 5
           else:
               set {_row} to 6
           close player's inventory
           wait 2 ticks
           open chest with {_row} rows named "&e> &aDuel :" to player
           wait 1 ticks
           set {_slot} to 0
           set {_nblist} to 1
           loop all players:
               if loop-value is not player:
                   if {_slot} = 53:
                       format slot {_slot} of player with 1 arrow named "&ePage 2" to close then run [make player execute command "duelsuite 1"]
                   else:
                       evaluate "format slot {_slot} of player with skull of ""%{_duel.list::%{_nblist}%}%"" parsed as offline player named ""%{_duel.list::%{_nblist}%}%"" with lore ""&7● &e<Texte> : &c<Variable>"" to close then run [make player execute command ""duel %{_duel.list::%{_nblist}%}%""]"
                       add 1 to {_slot}
                       add 1 to {_nblist}
       else:
           #Ligne pour lancer le duel.
           #ou
           make player execute command "lancer_le_duel %arg 1%"

command /duelsuite <number>:
   trigger:
       if arg 1 is not set:
           message "&cPrécisez une page !"
       else:
           loop all players:
               if loop-value is not player:
                   add loop-value to {_duel.list::*}
           set {_nb} to size of {_duel.list::*}
           if {_nb} is less than arg 1 * 53:
               message "&cIl n'y a pas autant de joueur sur le serveur !"
           else:
               set {_nblist} to 53 * arg 1
               if {_nb} is between {_nblist} and {_nblist} + 9:
                   set {_row} to 1
               else if {_nb} is between {_nblist} + 10 and {_nblist} + 18:
                   set {_row} to 2
               else if {_nb} is between {_nblist} + 19 and {_nblist} + 27:
                   set {_row} to 3
               else if {_nb} is between {_nblist} + 28 and {_nblist} + 36:
                   set {_row} to 4
               else if {_nb} is between {_nblist} + 37 and {_nblist} + 45:
                   set {_row} to 5
               else:
                   set {_row} to 6
               close player's inventory
               wait 2 ticks
               open chest with {_row} rows named "&e> &aDuel :" to player
               wait 1 ticks
               set {_slot} to 0
               set {_verif} to arg 1 + 1
               set {_verif2} to 53 * {_verif}
               loop all players:
                   if loop-value is not player:
                       if {_slot} = {_verif2}:
                           format slot {_slot} of player with 1 arrow named "&ePage %{_verif}%" to close then run [make player execute command "duelsuite %{_verif}%"]
                       else:
                           evaluate "format slot {_slot} of player with skull of ""%{_duel.list::%{_nblist}%}%"" parsed as offline player named ""%{_duel.list::%{_nblist}%}%"" with lore ""&7● &e<Texte> : &c<Variable>"" to close then run [make player execute command ""duel %{_duel.list::%{_nblist}%}%""]"
                           add 1 to {_slot}
                           add 1 to {_nblist}

Posté(e)
Salut je vais te faire ça :)

-----

J'ai essayer dit moi si il y a des erreurs, (Il faudra modifier la ligne 35 pour lancer le duel)

 

command /duel [<player>]:
   trigger:
       if arg 1 is not set:
           loop all players:
               if loop-value is not player:
                   add loop-value to {_duel.list::*}
           set {_nb} to size of {_duel.list::*}
           if {_nb} is between 1 and 9:
               set {_row} to 1
           else if {_nb} is between 10 and 18:
               set {_row} to 2
           else if {_nb} is between 19 and 27:
               set {_row} to 3
           else if {_nb} is between 28 and 36:
               set {_row} to 4
           else if {_nb} is between 37 and 45:
               set {_row} to 5
           else:
               set {_row} to 6
           close player's inventory
           wait 2 ticks
           open chest with {_row} rows named "&e> &aDuel :" to player
           wait 1 ticks
           set {_slot} to 0
           set {_nblist} to 1
           loop all players:
               if loop-value is not player:
                   if {_slot} = 53:
                       format slot {_slot} of player with 1 arrow named "&ePage 2" to close then run [make player execute command "duelsuite 1"]
                   else:
                       evaluate "format slot {_slot} of player with skull of ""%{_duel.list::%{_nblist}%}%"" parsed as offline player named ""%{_duel.list::%{_nblist}%}%"" with lore ""&7● &e<Texte> : &c<Variable>"" to close then run [make player execute command ""duel %{_duel.list::%{_nblist}%}%""]"
                       add 1 to {_slot}
                       add 1 to {_nblist}
       else:
           #Ligne pour lancer le duel.
           #ou
           make player execute command "lancer_le_duel %arg 1%"

command /duelsuite <number>:
   trigger:
       if arg 1 is not set:
           message "&cPrécisez une page !"
       else:
           loop all players:
               if loop-value is not player:
                   add loop-value to {_duel.list::*}
           set {_nb} to size of {_duel.list::*}
           if {_nb} is less than arg 1 * 53:
               message "&cIl n'y a pas autant de joueur sur le serveur !"
           else:
               set {_nblist} to 53 * arg 1
               if {_nb} is between {_nblist} and {_nblist} + 9:
                   set {_row} to 1
               else if {_nb} is between {_nblist} + 10 and {_nblist} + 18:
                   set {_row} to 2
               else if {_nb} is between {_nblist} + 19 and {_nblist} + 27:
                   set {_row} to 3
               else if {_nb} is between {_nblist} + 28 and {_nblist} + 36:
                   set {_row} to 4
               else if {_nb} is between {_nblist} + 37 and {_nblist} + 45:
                   set {_row} to 5
               else:
                   set {_row} to 6
               close player's inventory
               wait 2 ticks
               open chest with {_row} rows named "&e> &aDuel :" to player
               wait 1 ticks
               set {_slot} to 0
               set {_verif} to arg 1 + 1
               set {_verif2} to 53 * {_verif}
               loop all players:
                   if loop-value is not player:
                       if {_slot} = {_verif2}:
                           format slot {_slot} of player with 1 arrow named "&ePage %{_verif}%" to close then run [make player execute command "duelsuite %{_verif}%"]
                       else:
                           evaluate "format slot {_slot} of player with skull of ""%{_duel.list::%{_nblist}%}%"" parsed as offline player named ""%{_duel.list::%{_nblist}%}%"" with lore ""&7● &e<Texte> : &c<Variable>"" to close then run [make player execute command ""duel %{_duel.list::%{_nblist}%}%""]"
                           add 1 to {_slot}
                           add 1 to {_nblist}

Pour calculer {_row} tu pourrais faire plus rapidement en une ligne,

open chest with rounded down ((size of {_taliste::*} / 9) + 1) to player

Posté(e)
joke ? mdr c'est pas vraiment un "mini skript" mais bon

j'ai appellé ça comme ça car ce skript sera une petite partie du gros skript que je fais après je suis d'accord que quand on y réfléchi bien il c'est plutot un skript "baleze" ^^'

Posté(e)
Salut je vais te faire ça :)

-----

J'ai essayer dit moi si il y a des erreurs, (Il faudra modifier la ligne 35 pour lancer le duel)

 

command /duel [<player>]:
   trigger:
       if arg 1 is not set:
           loop all players:
               if loop-value is not player:
                   add loop-value to {_duel.list::*}
           set {_nb} to size of {_duel.list::*}
           if {_nb} is between 1 and 9:
               set {_row} to 1
           else if {_nb} is between 10 and 18:
               set {_row} to 2
           else if {_nb} is between 19 and 27:
               set {_row} to 3
           else if {_nb} is between 28 and 36:
               set {_row} to 4
           else if {_nb} is between 37 and 45:
               set {_row} to 5
           else:
               set {_row} to 6
           close player's inventory
           wait 2 ticks
           open chest with {_row} rows named "&e> &aDuel :" to player
           wait 1 ticks
           set {_slot} to 0
           set {_nblist} to 1
           loop all players:
               if loop-value is not player:
                   if {_slot} = 53:
                       format slot {_slot} of player with 1 arrow named "&ePage 2" to close then run [make player execute command "duelsuite 1"]
                   else:
                       evaluate "format slot {_slot} of player with skull of ""%{_duel.list::%{_nblist}%}%"" parsed as offline player named ""%{_duel.list::%{_nblist}%}%"" with lore ""&7● &e<Texte> : &c<Variable>"" to close then run [make player execute command ""duel %{_duel.list::%{_nblist}%}%""]"
                       add 1 to {_slot}
                       add 1 to {_nblist}
       else:
           #Ligne pour lancer le duel.
           #ou
           make player execute command "lancer_le_duel %arg 1%"

command /duelsuite <number>:
   trigger:
       if arg 1 is not set:
           message "&cPrécisez une page !"
       else:
           loop all players:
               if loop-value is not player:
                   add loop-value to {_duel.list::*}
           set {_nb} to size of {_duel.list::*}
           if {_nb} is less than arg 1 * 53:
               message "&cIl n'y a pas autant de joueur sur le serveur !"
           else:
               set {_nblist} to 53 * arg 1
               if {_nb} is between {_nblist} and {_nblist} + 9:
                   set {_row} to 1
               else if {_nb} is between {_nblist} + 10 and {_nblist} + 18:
                   set {_row} to 2
               else if {_nb} is between {_nblist} + 19 and {_nblist} + 27:
                   set {_row} to 3
               else if {_nb} is between {_nblist} + 28 and {_nblist} + 36:
                   set {_row} to 4
               else if {_nb} is between {_nblist} + 37 and {_nblist} + 45:
                   set {_row} to 5
               else:
                   set {_row} to 6
               close player's inventory
               wait 2 ticks
               open chest with {_row} rows named "&e> &aDuel :" to player
               wait 1 ticks
               set {_slot} to 0
               set {_verif} to arg 1 + 1
               set {_verif2} to 53 * {_verif}
               loop all players:
                   if loop-value is not player:
                       if {_slot} = {_verif2}:
                           format slot {_slot} of player with 1 arrow named "&ePage %{_verif}%" to close then run [make player execute command "duelsuite %{_verif}%"]
                       else:
                           evaluate "format slot {_slot} of player with skull of ""%{_duel.list::%{_nblist}%}%"" parsed as offline player named ""%{_duel.list::%{_nblist}%}%"" with lore ""&7● &e<Texte> : &c<Variable>"" to close then run [make player execute command ""duel %{_duel.list::%{_nblist}%}%""]"
                           add 1 to {_slot}
                           add 1 to {_nblist}

Salut ! déjà merci d'avoir pris le temps de faire ça :) mais il y'a quelques erreurs, quand tu loop all players: et qu'ensuite tu "if loop-value is not a player" le serveur me dit "There's no loop that matches 'loop-value' "

 

je ne sais pas trop de quoi il s'agit ^^ pourrais-tu m'aider ?

bonne soirée, cordialement, iSkix

Posté(e)
Salut je vais te faire ça :)

-----

J'ai essayer dit moi si il y a des erreurs, (Il faudra modifier la ligne 35 pour lancer le duel)

 

command /duel [<player>]:
   trigger:
       if arg 1 is not set:
           loop all players:
               if loop-value is not player:
                   add loop-value to {_duel.list::*}
           set {_nb} to size of {_duel.list::*}
           if {_nb} is between 1 and 9:
               set {_row} to 1
           else if {_nb} is between 10 and 18:
               set {_row} to 2
           else if {_nb} is between 19 and 27:
               set {_row} to 3
           else if {_nb} is between 28 and 36:
               set {_row} to 4
           else if {_nb} is between 37 and 45:
               set {_row} to 5
           else:
               set {_row} to 6
           close player's inventory
           wait 2 ticks
           open chest with {_row} rows named "&e> &aDuel :" to player
           wait 1 ticks
           set {_slot} to 0
           set {_nblist} to 1
           loop all players:
               if loop-value is not player:
                   if {_slot} = 53:
                       format slot {_slot} of player with 1 arrow named "&ePage 2" to close then run [make player execute command "duelsuite 1"]
                   else:
                       evaluate "format slot {_slot} of player with skull of ""%{_duel.list::%{_nblist}%}%"" parsed as offline player named ""%{_duel.list::%{_nblist}%}%"" with lore ""&7● &e<Texte> : &c<Variable>"" to close then run [make player execute command ""duel %{_duel.list::%{_nblist}%}%""]"
                       add 1 to {_slot}
                       add 1 to {_nblist}
       else:
           #Ligne pour lancer le duel.
           #ou
           make player execute command "lancer_le_duel %arg 1%"

command /duelsuite <number>:
   trigger:
       if arg 1 is not set:
           message "&cPrécisez une page !"
       else:
           loop all players:
               if loop-value is not player:
                   add loop-value to {_duel.list::*}
           set {_nb} to size of {_duel.list::*}
           if {_nb} is less than arg 1 * 53:
               message "&cIl n'y a pas autant de joueur sur le serveur !"
           else:
               set {_nblist} to 53 * arg 1
               if {_nb} is between {_nblist} and {_nblist} + 9:
                   set {_row} to 1
               else if {_nb} is between {_nblist} + 10 and {_nblist} + 18:
                   set {_row} to 2
               else if {_nb} is between {_nblist} + 19 and {_nblist} + 27:
                   set {_row} to 3
               else if {_nb} is between {_nblist} + 28 and {_nblist} + 36:
                   set {_row} to 4
               else if {_nb} is between {_nblist} + 37 and {_nblist} + 45:
                   set {_row} to 5
               else:
                   set {_row} to 6
               close player's inventory
               wait 2 ticks
               open chest with {_row} rows named "&e> &aDuel :" to player
               wait 1 ticks
               set {_slot} to 0
               set {_verif} to arg 1 + 1
               set {_verif2} to 53 * {_verif}
               loop all players:
                   if loop-value is not player:
                       if {_slot} = {_verif2}:
                           format slot {_slot} of player with 1 arrow named "&ePage %{_verif}%" to close then run [make player execute command "duelsuite %{_verif}%"]
                       else:
                           evaluate "format slot {_slot} of player with skull of ""%{_duel.list::%{_nblist}%}%"" parsed as offline player named ""%{_duel.list::%{_nblist}%}%"" with lore ""&7● &e<Texte> : &c<Variable>"" to close then run [make player execute command ""duel %{_duel.list::%{_nblist}%}%""]"
                           add 1 to {_slot}
                           add 1 to {_nblist}

 

resalut ! je te fais ce post suite a mon dernier commentaire:

 

Salut ! déjà merci d'avoir pris le temps de faire ça :) mais il y'a quelques erreurs, quand tu loop all players: et qu'ensuite tu "if loop-value is not a player" le serveur me dit "There's no loop that matches 'loop-value' "

 

je ne sais pas trop de quoi il s'agit ^^ pourrais-tu m'aider ?

bonne soirée, cordialement, iSkix

 

j'ai remplacé les loop-value par des loop-player et tout ça m'a l'air de fonctionner ! merci beaucoup parce que je ne trouvais pas de solutions automatisées à mon soucis :)

 

Bonne soirée :)

Posté(e)
Pour calculer {_row} tu pourrais faire plus rapidement en une ligne,

open chest with rounded down ((size of {_taliste::*} / 9) + 1) to player

Merci à toi pour ce petit conseil ;)

Posté(e)

De rien :D

 

pour ce qui est de la ligne :

open chest with rounded down ((size of {_taliste::*} / 9) + 1) to player

Car si il y a 120 Joueurs

il fera 120 / 9 + 1 ?

= 14 rows ? se qui créera une erreur ..

sauf si "rounded down" dit que sa doit être6 maximum ?

×
×
  • 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.