Aller au contenu
  • 0

Question

Posté(e)

Bonjour, j'ai fais un skript AntiAutoArmor qui marche, mais pas le cancel event pour replacer l'ancien item qui était dans le slot; voici mon code :

command /antiarmor <player>:
   trigger:
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       cancel event
       stop

Messages recommandés

  • 0
Posté(e) (modifié)

Enfaite, si le joueur n'a pas mis le plastron, retirer le plastron et remettre l'ancien item. Merci de m'avoir répondu !

 

Je te donne un exemple:

Avant avoir exécuter la commande, le joueur a une épée.

En exécutant la commande, le slot 0 (le premier slot) soit remplacé par l'armure en cuir qui lui si la personne a activé AutoArmor qui équipera automatiquement le plastron et se fera kick, si il n'a pas autoarmor, qui après 1 seconde retire le plastron du slot numéro 1 et l'armure soit remplacé par l'ancien item/block, une épée.

 

[Fusion de deux postes (Report)]

Modifié par Vengelis_
  • 0
Posté(e)

command /antiarmor <player>:
   trigger:
       set {armor.%arg 1%::plastron} to chestplate of player
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       set chestplate of player to {armor.%arg 1%::plastron}
       loop {armor.%arg 1%::*}:
           clear {armor.%arg 1%::%loop-index%}
       stop

 

Pas tester tu me dis si ca marche x)

  • 0
Posté(e)
command /antiarmor <player>:
   trigger:
       set {armor.%arg 1%::plastron} to chestplate of player
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       set chestplate of player to {armor.%arg 1%::plastron}
       loop {armor.%arg 1%::*}:
           clear {armor.%arg 1%::%loop-index%}
       stop

 

Pas tester tu me dis si ca marche x)

J'essaye maintenant !

  • 0
Posté(e) (modifié)
command /antiarmor <player>:
   trigger:
       set {inventaire.%arg 1%} to arg 1's inventory
       set {armor.%arg 1%::plastron} to chestplate of player
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       set chestplate of player to {armor.%arg 1%::plastron}
       clear player's inventory
       give {inventaire.%player%} to player
       loop {armor.%arg 1%::*}:
           clear {armor.%arg 1%::%loop-index%}
       stop

Modifié par Invité
  • 0
Posté(e)
command /antiarmor <player>:
   trigger:
       set {inventaire.%arg 1%} to arg 1's inventory
       set {armor.%arg 1%::plastron} to chestplate of player
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       set chestplate of player to {armor.%arg 1%::plastron}
       clear player's inventory
       give {inventaire.%player%} to player
        loop {armor.%arg 1%::*}:
           clear {armor.%arg 1%::%loop-index%}
       stop

Merci ! J'essaye et je te dit

  • 0
Posté(e)
command /antiarmor <player>:
   trigger:
       set {inventaire.%arg 1%} to arg 1's inventory
       set {armor.%arg 1%::plastron} to chestplate of player
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       set chestplate of player to {armor.%arg 1%::plastron}
       clear player's inventory
       give {inventaire.%player%} to player
       loop {armor.%arg 1%::*}:
           clear {armor.%arg 1%::%loop-index%}
       stop

Sa marche mais juste un petit problème : sa retire tout l'inventaire après les 1 secondes. Si tu veux les erreurs:

  • 0
Posté(e) (modifié)
command /antiarmor <player>:
 trigger:
    set {inventaire.%arg 1%} to arg 1's inventory
    set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
    wait 1 seconds
    if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
      execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
      send "&c&lAction efféctuée." to player
      set chestplate of player to {armor.%arg 1%::plastron}
      clear arg 1's inventory
      give {inventaire.%player%} to player

Modifié par Invité
  • 0
Posté(e)

Ton code avait encore quelque problème, mais au niveaux des espaces et tout, par contre, j'ai tout remplacé par des tabs :/

Mais j'ai encore une erreur : [ATTACH=full]8408[/ATTACH], voila le code modifié:

command /antiarmor <player>:
   trigger:
       set {inventaire.%arg 1%} to arg 1's inventory
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       set chestplate of player to {armor.%arg 1%::plastron}
       clear player's inventory
       give {inventaire.%player%} to arg 1

  • 0
Posté(e)
remplace le clear player's inventory par : clear arg 1's inventory

Même erreur ; enfaite, je sais pas si je l'ai dit avant, après, l'inventaire se supprime, mais les items ne sont aps rendu.

  • 0
Posté(e) (modifié)
command /antiarmor <player>:
   trigger:
       set {inventaire.%arg 1%} to arg 1's inventory
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       set chestplate of player to {armor.%arg 1%::plastron}
       clear arg 1's inventory
       give {inventaire.%arg 1%} to arg 1

Modifié par Invité
  • 0
Posté(e)
command /antiarmor <player>:
   trigger:
       set {inventaire.%arg 1%} to arg 1's inventory
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       set chestplate of player to {armor.%arg 1%::plastron}
       clear arg 1's inventory
       give {inventaire.%arg 1%} to arg 1

Même problème :/ Si tu veux des précisions, pas de problème, si tu veux, je suis en 1.12.2.

  • 0
Posté(e)
command /antiarmor <player>:
   trigger:
       set {inventaire.%arg 1%} to serialized contents of arg 1's inventory
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       clear arg 1's inventory
       give {inventaire.%arg 1%} to arg 1

  • 0
Posté(e)
command /antiarmor <player>:
   trigger:
       set {inventaire.%arg 1%} to serialized contents of arg 1's inventory
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       clear arg 1's inventory
       give {inventaire.%arg 1%} to arg 1

Encore même problème, pas d'erreur mais le truc qui remet l'ancien inventaire marche pas. Parcontre je dois arrêter on reprend demain a 16h30 ok ? Bonne journée et merci d'avoir essayer de m'aider :p

  • 0
Posté(e)

T'inquiéte :)

Je te donne le nouveau code ( Il est censé marcher normalement celui là x) ) Tu le testeras demain comme tu dis :)

command /antiarmor <player>:
   trigger:
       set {inventaire.%arg 1%} to serialized contents of arg 1's inventory
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       clear arg 1's inventory
       set arg 1's inventory's serialized contents to {inventaire.%arg 1%}

  • 0
Posté(e) (modifié)
T'inquiéte :)

Je te donne le nouveau code ( Il est censé marcher normalement celui là x) ) Tu le testeras demain comme tu dis :)

command /antiarmor <player>:
   trigger:
       set {inventaire.%arg 1%} to serialized contents of arg 1's inventory
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       clear arg 1's inventory
       set arg 1's inventory's serialized contents to {inventaire.%arg 1%}

J'ai pu rentrer plus tôt :) Je te dit sa maintenant !

 

T'inquiéte :)

Je te donne le nouveau code ( Il est censé marcher normalement celui là x) ) Tu le testeras demain comme tu dis :)

command /antiarmor <player>:
   trigger:
       set {inventaire.%arg 1%} to serialized contents of arg 1's inventory
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       clear arg 1's inventory
       set arg 1's inventory's serialized contents to {inventaire.%arg 1%}

Toujours et encore même problème, l'inventaire n'est pas rendu, aucune erreur par contre dans la console ou sur le reload :/

 

[Fusion de deux postes]

Modifié par Vengelis_
  • 0
Posté(e)
T'inquiéte :)

Je te donne le nouveau code ( Il est censé marcher normalement celui là x) ) Tu le testeras demain comme tu dis :)

command /antiarmor <player>:
   trigger:
       set {inventaire.%arg 1%} to serialized contents of arg 1's inventory
       set slot 0 of arg 1 to leather_chestplate named "&c&lAntiCheat"
       wait 1 seconds
       if chestplate of arg 1 is leather chestplate named "&c&lAntiCheat":
           execute console command "/kick %arg 1% &c&lAntiCheat: &6&lAutoArmor n'est pas autorisée."
       send "&c&lAction efféctuée." to player
       clear arg 1's inventory
       set arg 1's inventory's serialized contents to {inventaire.%arg 1%}

J'ai trouvé un code sur internet si tu veux l'utiliser, j'ai essayé et il marche; le voici

 

command /save-inventory:
   trigger:
       set {_count} to 0
       loop 36 times:
           set {inv.%UUID of player%.%{_count}%} to slot {_count} of player's inventory
           add 1 to {_count}   
       wait 15 ticks
       send "&aInventaire sauvergardé !"
       stop

command /load-inventory:
   trigger:
       set {_count} to 0
       loop 36 times:
           set slot {_count} of player's inventory to {inv.%UUID of player%.%{_count}%}
           add 1 to {_count}
       wait 15 ticks
       send "&aInventaire reçu !"

Invité
Ce sujet ne peut plus recevoir de nouvelles réponses.
×
×
  • 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.