Aller au contenu
  • 0

Inventaire d'un joueur dans un GUI


Question

Posté(e)

Bonsoir, je suis en 1.8 et j'aimerai savoir si dans ma commande il est possible d'avoir l'inventaire d'un joueur dans des slots précis?

 

mon code :

command /verif <player>:
   permission: mod.use
   permission message: &8[&cMod&8] &eTu n'as pas la permission de vérif !
   trigger:
       open chest with 6 rows named "&c&lVÉRIF &8&l>> &e%arg 1%" to player
       format slot 0 of player with skull of "MHF_Exclamation" parsed as offline player named "&e<none> = il est tout nu !" to be unstealable
       format slot 7 of player with skull of "MHF_ArrowRight" parsed as offline player named "&e<none> = il est tout nu !" to be unstealable
       format slot 16 of player with skull of "MHF_ArrowRight" parsed as offline player named "&e<none> = il est tout nu !" to be unstealable
       format slot 25 of player with skull of "MHF_ArrowRight" parsed as offline player named "&e<none> = il est tout nu !" to be unstealable
       format slot 34 of player with skull of "MHF_ArrowRight" parsed as offline player named "&e<none> = il est tout nu !" to be unstealable
       format slot 8 of player with arg's helmet named "&aCasque du Joueur" with lore "&e→ &eLe joueur à comme casque un :||&e→ &6%arg's helmet%" to be unstealable
       format slot 17 of player with arg's chestplate named "&aPlastron du Joueur" with lore "&e► Le joueur à comme plastron un :||&e→ &6%arg's chestplate%" to be unstealable
       format slot 26 of player with arg's leggings named "&aPantalon du Joueur" with lore "&e► Le joueur à comme pantalon un :||&e→ &6%arg's leggings%" to be unstealable
       format slot 35 of player with arg's boots named "&aBotte du Joueur" with lore "&e► Le joueur à comme botte un :||&e→ &6%arg's boots%" to be unstealable
#'%%

3 réponses à cette question

Messages recommandés

  • 0
Posté(e)
Bonsoir, je suis en 1.8 et j'aimerai savoir si dans ma commande il est possible d'avoir l'inventaire d'un joueur dans des slots précis?

 

mon code :

command /verif <player>:
   permission: mod.use
   permission message: &8[&cMod&8] &eTu n'as pas la permission de vérif !
   trigger:
       open chest with 6 rows named "&c&lVÉRIF &8&l>> &e%arg 1%" to player
       format slot 0 of player with skull of "MHF_Exclamation" parsed as offline player named "&e<none> = il est tout nu !" to be unstealable
       format slot 7 of player with skull of "MHF_ArrowRight" parsed as offline player named "&e<none> = il est tout nu !" to be unstealable
       format slot 16 of player with skull of "MHF_ArrowRight" parsed as offline player named "&e<none> = il est tout nu !" to be unstealable
       format slot 25 of player with skull of "MHF_ArrowRight" parsed as offline player named "&e<none> = il est tout nu !" to be unstealable
       format slot 34 of player with skull of "MHF_ArrowRight" parsed as offline player named "&e<none> = il est tout nu !" to be unstealable
       format slot 8 of player with arg's helmet named "&aCasque du Joueur" with lore "&e→ &eLe joueur à comme casque un :||&e→ &6%arg's helmet%" to be unstealable
       format slot 17 of player with arg's chestplate named "&aPlastron du Joueur" with lore "&e► Le joueur à comme plastron un :||&e→ &6%arg's chestplate%" to be unstealable
       format slot 26 of player with arg's leggings named "&aPantalon du Joueur" with lore "&e► Le joueur à comme pantalon un :||&e→ &6%arg's leggings%" to be unstealable
       format slot 35 of player with arg's boots named "&aBotte du Joueur" with lore "&e► Le joueur à comme botte un :||&e→ &6%arg's boots%" to be unstealable
#'%%

La même chose en plus complet :) (extrait du Skript partie ressource MOD.SK !)

[spoiler=code]

command /verif <player>:
   aliases: invsee
   permission: moder
   permission message: &fMauvaise commande.
   trigger:
       wait 1 tick
       if {target.hide.%arg 1%} is true:
           message "&2[invView]&4 Ce joueur ne peux pas être visionné!"
       else:
           set {target.%player%} to arg 1
           open chest with 6 rows named "&a&lVérif &7> &b%arg 1%" to player
           set {_playerinv} to arg 1
           set {_slot} to 0
           loop 36 times:
               set {invview.%arg 1%.%{_slot}%} to slot {_slot} of arg 1's inventory
               add 1 to {_slot}
           set {_slot} to 0
           set {_slotmenu} to 18
           wait 1 tick
           loop 36 times:
               format slot {_slotmenu} of player with {invview.%arg 1%.%{_slot}%} to close
               add 1 to {_slot}
               add 1 to {_slotmenu}
           set {_health.%arg 1%} to arg 1's health
           set {hunger.%arg 1%} to arg 1's hunger
           set {armorview.helmet.%arg 1%} to arg 1's helmet
           set {armorview.chestplate.%arg 1%} to arg 1's chestplate
           set {armorview.leggings.%arg 1%} to arg 1's leggings
           set {armorview.boots.%arg 1%} to arg 1's boots
           if arg 1's gamemode is survival:
               format slot 4 of player with arg 1's skull named "&a&l%arg 1% &7> &ben surive" to close
           else:
               format slot 4 of player with arg 1's skull named "&a&l%arg 1% &7> &ben créatif" to close
           if arg 1's gamemode is survival:
               if {hunger.%arg 1%} = 10:
                   format slot 14 of player with 10 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 9.5:
                   format slot 14 of player with 10 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 9:
                   format slot 14 of player with 9 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 8.5:
                   format slot 14 of player with 9 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 8:
                   format slot 14 of player with 8 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 7.5:
                   format slot 14 of player with 8 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 7:
                   format slot 14 of player with 7 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 6.5:
                   format slot 14 of player with 7 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 6:
                   format slot 14 of player with 6 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 5.5:
                   format slot 14 of player with 6 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 5:
                   format slot 14 of player with 5 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 4.5:
                   format slot 14 of player with 5 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 4:
                   format slot 14 of player with 4 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 3.5:
                   format slot 14 of player with 4 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 3:
                   format slot 14 of player with 3 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 2.5:
                   format slot 14 of player with 3 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 2:
                   format slot 14 of player with 2 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 1.5:
                   format slot 14 of player with 2 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 1:
                   format slot 14 of player with steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 0.5:
                   format slot 14 of player with steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 0:
                   format slot 14 of player with steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
           else:
               format slot 14 of player with steak named "&a&lNourriture &7:&r &6Illimitée !" to close
           if arg 1's gamemode is survival:
               format slot 12 of player with iron chestplate named "&a&lArmure" with lore "&6%{armorview.helmet.%arg 1%}%||&6%{armorview.chestplate.%arg 1%}%||&6%{armorview.leggings.%arg 1%}%||&6%{armorview.boots.%arg 1%}%" to close
           else:
               format slot 12 of player with iron chestplate named "&a&lArmure" with lore "&6Joueur en créatif !" to close
           format slot 8 of player with sunflower named "&4&lActualiser" to close then run [make player execute command "invreload"]
           format slot 0 of player with torch named "&a&lInformations &7:" with lore "&cMax CPS: %{maxclicks.%arg 1%}% ||&cCPS: %{clicks.%arg 1%}%||&cAlertes: %{alerts.%arg 1%}% " to be unstealable   
           format slot 13 of player with apple named "&a&lVie &7: &4%{_health.%arg 1%}%&4 ❤" to close
           while inventory name of player's current inventory is "&a&lVérif &7> &b%arg 1%":
               wait 0.5 second           
               format slot 0 of player with torch named "&a&lInformations &7:" with lore "&cMax CPS: %{maxclicks.%arg 1%}% ||&cCPS: %{clicks.%arg 1%}%||&cAlertes: %{alerts.%arg 1%}% " to be unstealable
           set {_slot} to 0
           loop 36 times:
               delete {invview.%arg 1%.%{_slot}%}
               add 1 to {_slot}
           delete {_slotmenu}
           delete {_slot}
           delete {_health.%arg 1%}
           delete {hunger.%arg 1%}
           delete {armorview.helmet.%arg 1%}
           delete {armorview.chestplate.%arg 1%}
           delete {armorview.leggings.%arg 1%}
           delete {armorview.boots.%arg 1%}
           delete {target.%player%}
           delete {_playerinv}
           delete {_slot}

 

 

  • J'aime 1
  • 0
Posté(e)
La même chose en plus complet :) (extrait du Skript partie ressource MOD.SK !)

[spoiler=code]

command /verif <player>:
   aliases: invsee
   permission: moder
   permission message: &fMauvaise commande.
   trigger:
       wait 1 tick
       if {target.hide.%arg 1%} is true:
           message "&2[invView]&4 Ce joueur ne peux pas être visionné!"
       else:
           set {target.%player%} to arg 1
           open chest with 6 rows named "&a&lVérif &7> &b%arg 1%" to player
           set {_playerinv} to arg 1
           set {_slot} to 0
           loop 36 times:
               set {invview.%arg 1%.%{_slot}%} to slot {_slot} of arg 1's inventory
               add 1 to {_slot}
           set {_slot} to 0
           set {_slotmenu} to 18
           wait 1 tick
           loop 36 times:
               format slot {_slotmenu} of player with {invview.%arg 1%.%{_slot}%} to close
               add 1 to {_slot}
               add 1 to {_slotmenu}
           set {_health.%arg 1%} to arg 1's health
           set {hunger.%arg 1%} to arg 1's hunger
           set {armorview.helmet.%arg 1%} to arg 1's helmet
           set {armorview.chestplate.%arg 1%} to arg 1's chestplate
           set {armorview.leggings.%arg 1%} to arg 1's leggings
           set {armorview.boots.%arg 1%} to arg 1's boots
           if arg 1's gamemode is survival:
               format slot 4 of player with arg 1's skull named "&a&l%arg 1% &7> &ben surive" to close
           else:
               format slot 4 of player with arg 1's skull named "&a&l%arg 1% &7> &ben créatif" to close
           if arg 1's gamemode is survival:
               if {hunger.%arg 1%} = 10:
                   format slot 14 of player with 10 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 9.5:
                   format slot 14 of player with 10 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 9:
                   format slot 14 of player with 9 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 8.5:
                   format slot 14 of player with 9 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 8:
                   format slot 14 of player with 8 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 7.5:
                   format slot 14 of player with 8 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 7:
                   format slot 14 of player with 7 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 6.5:
                   format slot 14 of player with 7 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 6:
                   format slot 14 of player with 6 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 5.5:
                   format slot 14 of player with 6 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 5:
                   format slot 14 of player with 5 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 4.5:
                   format slot 14 of player with 5 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 4:
                   format slot 14 of player with 4 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 3.5:
                   format slot 14 of player with 4 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 3:
                   format slot 14 of player with 3 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 2.5:
                   format slot 14 of player with 3 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 2:
                   format slot 14 of player with 2 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 1.5:
                   format slot 14 of player with 2 steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 1:
                   format slot 14 of player with steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 0.5:
                   format slot 14 of player with steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
               if {hunger.%arg 1%} = 0:
                   format slot 14 of player with steak named "&a&lNourriture &7:&r &6%{hunger.%arg 1%}%" to close
           else:
               format slot 14 of player with steak named "&a&lNourriture &7:&r &6Illimitée !" to close
           if arg 1's gamemode is survival:
               format slot 12 of player with iron chestplate named "&a&lArmure" with lore "&6%{armorview.helmet.%arg 1%}%||&6%{armorview.chestplate.%arg 1%}%||&6%{armorview.leggings.%arg 1%}%||&6%{armorview.boots.%arg 1%}%" to close
           else:
               format slot 12 of player with iron chestplate named "&a&lArmure" with lore "&6Joueur en créatif !" to close
           format slot 8 of player with sunflower named "&4&lActualiser" to close then run [make player execute command "invreload"]
           format slot 0 of player with torch named "&a&lInformations &7:" with lore "&cMax CPS: %{maxclicks.%arg 1%}% ||&cCPS: %{clicks.%arg 1%}%||&cAlertes: %{alerts.%arg 1%}% " to be unstealable  
           format slot 13 of player with apple named "&a&lVie &7: &4%{_health.%arg 1%}%&4 ❤" to close
           while inventory name of player's current inventory is "&a&lVérif &7> &b%arg 1%":
               wait 0.5 second          
               format slot 0 of player with torch named "&a&lInformations &7:" with lore "&cMax CPS: %{maxclicks.%arg 1%}% ||&cCPS: %{clicks.%arg 1%}%||&cAlertes: %{alerts.%arg 1%}% " to be unstealable
           set {_slot} to 0
           loop 36 times:
               delete {invview.%arg 1%.%{_slot}%}
               add 1 to {_slot}
           delete {_slotmenu}
           delete {_slot}
           delete {_health.%arg 1%}
           delete {hunger.%arg 1%}
           delete {armorview.helmet.%arg 1%}
           delete {armorview.chestplate.%arg 1%}
           delete {armorview.leggings.%arg 1%}
           delete {armorview.boots.%arg 1%}
           delete {target.%player%}
           delete {_playerinv}
           delete {_slot}

 

Merci ! :)

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