Aller au contenu
  • 0

Problèmes de variables dans un panneau


Question

Posté(e)

Bonjour à tous, aujourd'hui j'ai un problème.

 

[spoiler=Voici le code]

command /bs [<text>] [<text>] [<text>] [<text>]:
   trigger:
       if arg 2 is not set:
           send "&c/bs add &7[server] [Nom] [iP]"
       if targeted block is sign:
           add location of targeted block to {sk.bs::*}
           add arg 4 to {ip.sk.bs::*}
           set line 1 of block at targeted block to "&7[&aRejoindre&7]"
           set line 2 of block at targeted block to "&c%arg 3%"


every 1 second:
   if {sk.bs::*} is set:
       loop {ip.sk.bs::*}:
           set {_g} to text from "http://mcping.net/api/%loop-value-1%/online"
           replace all "}", "{", """", "online",  ":" and " " with "" in {_g}
           loop {sk.bs::*}:
               set line 3 of block at location of loop-value-2 to "&eJoueurs: &a%{_g}%"

on mine:
   if event-block is sign:
       loop {sk.bs::*}:
           if event-block is loop-value:
               remove event-block from {sk.bs::*}

 

 

 

Quand je set le panneau aucun problèmes, le nombres de connectés marche bien, toutes les 1 seconde le panneau se refresh.

[spoiler=Screen]1453648745-sign.png

 

Le problème:

Quand je Set plusieurs panneau le nombre de joueurs dans la 3ème lignes et la même valeur pour chaque panneau.

 

[spoiler=Screen Example]1453648873-signs2.png

 

6 réponses à cette question

Messages recommandés

  • 0
Posté(e)
Aidez moi :'(

Une journée avant de UP.

 

Il est tard mais j'essaie ! :D

variables:
nmbrePanneaux: 0

command /bs [<text>] [<text>] [<text>] [<text>]:
   trigger:
       if arg 2 is not set:
           send "&c/bs add &7[server] [Nom] [iP]"
       if targeted block is sign:
 add 1 to {nmbrePanneaux}
           set {sk.bs::%{nmbrePanneaux}%} to location of targeted block
           set {ip.sk.bs::%{nmbrePanneaux}%} to arg 4
           set line 1 of block at targeted block to "&7[&aRejoindre&7]"
           set line 2 of block at targeted block to "&c%arg 3%"


every 1 second:
   if {nmbrePanneaux} >= 1:
set {_count} to 0
       loop {nmbrePanneaux} times:
 set {_g} to text from "http://mcping.net/api/%{ip.sk.bs::%{_count}%} %/online"
           replace all "}", "{", """", "online",  ":" and " " with "" in {_g}
           set line 3 of block at location of {sk.bs::%{_count}%} to "&eJoueurs: &a%{_g}%"

on mine:
   if event-block is sign:
       if {sk.bs::*} contains event-block:
           remove event-block from {sk.bs::*}

  • 0
Posté(e)

Parce-que je veux pas savoir le nombre de personnes sur mon serveur, je veux un autre serveur lié avec BungeeCord.

Et donc j'utilise l'API en ligne pour savoir le nombre de joueurs connectés que je met en variable.

  • 0
Posté(e)
Une journée avant de UP.

 

Il est tard mais j'essaie ! :D

variables:
nmbrePanneaux: 0

command /bs [<text>] [<text>] [<text>] [<text>]:
   trigger:
       if arg 2 is not set:
           send "&c/bs add &7[server] [Nom] [iP]"
       if targeted block is sign:
 add 1 to {nmbrePanneaux}
           set {sk.bs::%{nmbrePanneaux}%} to location of targeted block
           set {ip.sk.bs::%{nmbrePanneaux}%} to arg 4
           set line 1 of block at targeted block to "&7[&aRejoindre&7]"
           set line 2 of block at targeted block to "&c%arg 3%"


every 1 second:
   if {nmbrePanneaux} >= 1:
set {_count} to 0
       loop {nmbrePanneaux} times:
 set {_g} to text from "http://mcping.net/api/%{ip.sk.bs::%{_count}%} %/online"
           replace all "}", "{", """", "online",  ":" and " " with "" in {_g}
           set line 3 of block at location of {sk.bs::%{_count}%} to "&eJoueurs: &a%{_g}%"

on mine:
   if event-block is sign:
       if {sk.bs::*} contains event-block:
           remove event-block from {sk.bs::*}

J'ai tout repositionner et ton code ne fonctionne pas, aucune erreur mais le nombre de joueurs ne s'affiche pas.

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