Aller au contenu

Avoir le temps d'un joueur connecté


Messages recommandés

Posté(e)

Bonsoir, je suis en version 1.8 et je bloque un peu. J'aimerai avoir le temps de jeu d'une personne en Day Heures minutes secondes si possible, et que bien sur, 60 secondes se convertissent en 1 minute et 60 minutes en 1 heure et 24 heures en 1 day.

 

Je n'ai pas le début du skript car je ne sais pas comment et où commencer. Merci ! :)

Posté(e)
on join:
   set {%player%.connect} to now

On quit:
   delete {%player%.connect}

command /view:
   trigger:
       set {_DiffTempsConnect} to difference between {%player%.connect} and now
       send "&f&m-----------------------------"
       send ""
       send " &6&lTemps de connection &f&l: &b&l"

Posté(e)
on join:
   set {%player%.connect} to now

On quit:
   delete {%player%.connect}

command /view:
   trigger:
       set {_DiffTempsConnect} to difference between {%player%.connect} and now
       send "&f&m-----------------------------"
       send ""
       send " &6&lTemps de connection &f&l: &b&l"

ça ne marche pas. je ne saurai te dire pourquoi si je mets %{%player%...} ça me dit une erreur et <none>.

Posté(e)

Voilà:

on first join:
   set {seconds.%uuid of player%} to 0
   set {mins.%uuid of player%} to 0
   set {hours.%uuid of player%} to 0
   set {days.%uuid of player%} to 0
   while player is online:
       wait 1 second
       add 1 to {seconds.%uuid of player%}
       if {seconds.%uuid of player%} = 60:
           set {seconds.%uuid of player%} to 0
           add 1 to {mins.%uuid of player%}
           if {mins.%uuid of player%} = 60:
               set {mins.%uuid of player%} to 0
               add 1 to {hours.%uuid of player%}
               if {hours.%uuid of player%} = 24:
                   set {hours.%uuid of player%} to 0
                   add 1 to {days.%uuid of player%}
join:
   while player is online:
       wait 1 second
       add 1 to {seconds.%uuid of player%}
       if {seconds.%uuid of player%} = 60:
           set {seconds.%uuid of player%} to 0
           add 1 to {mins.%uuid of player%}
           if {mins.%uuid of player%} = 60:
               set {mins.%uuid of player%} to 0
               add 1 to {hours.%uuid of player%}
               if {hours.%uuid of player%} = 24:
                   set {hours.%uuid of player%} to 0
                   add 1 to {days.%uuid of player%}
command /knowtime:
       trigger:
               send "%{days.%uuid of player%}% :: %{hours.%uuid of player%}% :: %{mins.%uuid of player%}% :: %{seconds.%uuid of player%}%"

  • J'aime 1
Posté(e)
Voilà:

on first join:
   set {seconds.%uuid of player%} to 0
   set {mins.%uuid of player%} to 0
   set {hours.%uuid of player%} to 0
   set {days.%uuid of player%} to 0
   while player is online:
       wait 1 second
       add 1 to {seconds.%uuid of player%}
       if {seconds.%uuid of player%} = 60:
           set {seconds.%uuid of player%} to 0
           add 1 to {mins.%uuid of player%}
           if {mins.%uuid of player%} = 60:
               set {mins.%uuid of player%} to 0
               add 1 to {hours.%uuid of player%}
               if {hours.%uuid of player%} = 24:
                   set {hours.%uuid of player%} to 0
                   add 1 to {days.%uuid of player%}
join:
   while player is online:
       wait 1 second
       add 1 to {seconds.%uuid of player%}
       if {seconds.%uuid of player%} = 60:
           set {seconds.%uuid of player%} to 0
           add 1 to {mins.%uuid of player%}
           if {mins.%uuid of player%} = 60:
               set {mins.%uuid of player%} to 0
               add 1 to {hours.%uuid of player%}
               else if {hours.%uuid of player%} = 24:
                   set {hours.%uuid of player%} to 0
                   add 1 to {days.%uuid of player%}
command /knowtime:
       trigger:
               send "send "%{days.%uuid of player%}% :: %{hours.%uuid of player%}% :: %{mins.%uuid of player%}% :: %{seconds.%uuid of player%}%""

Merci ! Or ça me dit

[ATTACH=full]4789[/ATTACH]

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