Aller au contenu

Systeme de salaire


Messages recommandés

Posté(e)

Bonjour à tout les skripteurs je suis ici aujourd'hui pour vous demander de l'aide , effectivement je cherche depuis 2 jours à faire un systeme de salaire , le principe:

 

Que toutes les 24h un jours puisse faire /salaire et recevoir 6000 po (que ca execute la commande /eco give <player> 6000)

Posté(e)
function getTimeLeft(diff: timespan, cooldown: timespan) :: string:
   subtract {_diff} from {_cooldown}
   set {_cooldown} to "%{_cooldown}%" parsed as string
   replace all "second" with "seconde" in {_cooldown}
   replace all "seconds" with "secondes" in {_cooldown}
   replace all "hour" with "heure" in {_cooldown}
   replace all "hours" with "heures" in {_cooldown}
   replace all "day" with "jour" in {_cooldown}
   replace all "days" with "jours" in {_cooldown}
   replace all "and" with "et" in {_cooldown}
   return {_cooldown}

command /salaire:
   trigger:
       if difference between now and {salaire.%player%.lu} is less than 24 hours:
           send "&cPatiente encore &b%getTimeLeft(difference between now and {salaire.%player%.lu}, 24 hours)% &c!"
       else:
           execute console command "/eco give %player% 6000"
           send "&aVous avez reçu votre salaire !"
           set {salaire.%player%.lu} to now

Posté(e)

Bonjour, tien :

command /salaire:
   trigger:   
       if {Salaire.cooldown.%player%} is not set:
           set {Salaire.cooldown.%player%} to now
           execute console command "/eco give %player% 6000"
           message "&2> &aVous avez reçu votre salaire &66000$"
       else:
           if difference between {Salaire.cooldown.%player%} and now >= 24 hours:
               set {Salaire.cooldown.%player%} to now
               execute console command "/eco give %player% 6000"
               message "&2>> &aVous avez reçu votre salaire &66000$"
           else:   
               set {_sl} to {Salaire.cooldown.%player%}
               add 24 hours to {_sl}
               set {_sl} to difference between {_sl} and now
               message "&2>> &aVous devez encore attendre &6%{_sl}% &aavant d'avoir votre salaire"

Posté(e)

Oui mais les secondes sont des 100aine , ca marque 23h46,80 etc

 

Aussi serait il possible d'avoir ton skype car j'ai plusieurs demandes , si tu ne veux pas je le comprend :)

Posté(e)

Bin c'est ce que j'ai fait je te dis. Suffit juste de modifier les replaces.

 

function getTimeLeft(diff: timespan, cooldown: timespan) :: string:
   subtract {_diff} from {_cooldown}
   set {_cooldown} to "%{_cooldown}%" parsed as string
   replace all "second" with "s" in {_cooldown}
   replace all "seconds" with "s" in {_cooldown}
   replace all "minute" with "m" in {_cooldown}
   replace all "minutes" with "m" in {_cooldown}
   replace all "hour" with "h" in {_cooldown}
   replace all "hours" with "h" in {_cooldown}
   replace all "day" with "j" in {_cooldown}
   replace all "days" with "j" in {_cooldown}
   replace all " and " with "" in {_cooldown}
   return {_cooldown}

command /salaire:
   trigger:
       if difference between now and {salaire.%player%.lu} is less than 24 hours:
           send "&cPatiente encore &b%getTimeLeft(difference between now and {salaire.%player%.lu}, 24 hours)% &c!"
       else:
           execute console command "/eco give %player% 6000"
           send "&aVous avez reçu votre salaire !"
           set {salaire.%player%.lu} to now

Posté(e)

alors dans les skripts:

 


command /salaire:
   trigger:  
       if {Salaire.cooldown.%player%} is not set:
           set {Salaire.cooldown.%player%} to now
           execute console command "/eco give %player% 6000"
           message "&2> &aVous avez reçu votre salaire &66000$"
       else:
           if difference between {Salaire.cooldown.%player%} and now >= 24 hours:
               set {Salaire.cooldown.%player%} to now
               execute console command "/eco give %player% 6000"
               message "&2>> &aVous avez reçu votre salaire &66000$"
           else:  
               set {_sl} to {Salaire.cooldown.%player%}
               add 24 hours to {_sl}
               set {_sl} to difference between {_sl} and now
               message "&2>> &aVous devez encore attendre &6%{_sl}% &aavant d'avoir votre salaire"

et aussi

 

# Script name: RenameItem
# Script author: Sokrax
# Script version: 1.2

#|---------|OPTIONS & MESSAGES|---------|#
options:
   logo: &e[&4Rename&e]
   permissionlore: setlore.sk
   permissionname: setname.sk
   usageheader: &c-&f-&c-&f-&c-&f=&c= &9&oUtilisation&8 &c=&f=&c-&f-&c-&f-&c-
   usagemessage1:&d/Lore &aSet &5ligne &esous-titre.
   usagemessage2:&d/Lore &csupprimer &5ligne.
   usagemessage3:&d/setname &enom.
   errormessage: &ctu n'as pas la permission.
   successfulSet: &eSous titre ajouté avec succes.
   successfulRemove: &eTu as bien supprimé le sous titre.
   successfulSetname: &eTu as bien changé le nom de l'item.

command /Lore [<text>] [<number>] [<text>]:
   aliases: /l
   trigger:
       if player has permission "{@permissionlore}":
           if arg 1 is not set:
               message "{@usageheader}"
               message "{@usagemessage1}"
               message "{@usagemessage2}"
               message "{@usagemessage3}"
           else if arg 1 is "set":
               if number arg is set:
                   if arg 3 is set:
                       set line number arg of lore of player's tool to "%colored arg 3%"
                       message "{@successfulSet}"
           else if arg 1 is "remove":
               if number arg is set:
                   set line number arg of lore of player's tool to ""
                   message "{@successfulRemove}"
           else if arg 1 is "help":
               message "{@usageheader}"
               message "{@usagemessage1}"
               message "{@usagemessage2}"
               message "{@usagemessage3}"
       else:
           message "{@logo} {@errormessage}"
           stop trigger

command /setname [<text>]:
   aliases: /n
   trigger:
       if player has permission "{@permissionname}":
           if arg 1 is not set:
               message "{@usageheader}"
               message "{@usagemessage1}"
               message "{@usagemessage2}"
               message "{@usagemessage3}"
           else:
               set name of player's tool to "%colored arg 1%"
               message "{@successfulSetname}"

       else:
           message "{@errormessage}"
           stop trigger

Posté(e)

Permission: salaire.use

command /salaire:
   permission: salaire.use
   trigger: 
       if {Salaire.cooldown.%player%} is not set:
           set {Salaire.cooldown.%player%} to now
           execute console command "/eco give %player% 6000"
           message "&2> &aVous avez reçu votre salaire &66000$"
       else:
           if difference between {Salaire.cooldown.%player%} and now >= 24 hours:
               set {Salaire.cooldown.%player%} to now
               execute console command "/eco give %player% 6000"
               message "&2>> &aVous avez reçu votre salaire &66000$"
           else: 
               set {_sl} to {Salaire.cooldown.%player%}
               add 24 hours to {_sl}
               set {_sl} to difference between {_sl} and now
               message "&2>> &aVous devez encore attendre &6%{_sl}% &aavant d'avoir votre salaire"

 

Les permissions sont déjà mises sur ton deuxième skript, ce sont les permission setlore.sk et setname.sk

Posté(e)
Bonjour à tout les skripteurs je suis ici aujourd'hui pour vous demander de l'aide , effectivement je cherche depuis 2 jours à faire un systeme de salaire , le principe:

 

Que toutes les 24h un jours puisse faire /salaire et recevoir 6000 po (que ca execute la commande /eco give <player> 6000)

function getTimeLeft(diff: timespan, cooldown: timespan) :: string:
   subtract {_diff} from {_cooldown}
   set {_cooldown} to "%{_cooldown}%" parsed as string
   replace all "second" with "seconde" in {_cooldown}
   replace all "seconds" with "secondes" in {_cooldown}
   replace all "hour" with "heure" in {_cooldown}
   replace all "hours" with "heures" in {_cooldown}
   replace all "day" with "jour" in {_cooldown}
   replace all "days" with "jours" in {_cooldown}
   replace all "and" with "et" in {_cooldown}
   return {_cooldown}

command /salaire:
   trigger:
       if difference between now and {salaire.%player%.lu} is less than 24 hours:
           send "&cPatiente encore &b%getTimeLeft(difference between now and {salaire.%player%.lu}, 24 hours)% &c!"
       else:
           execute console command "/eco give %player% 6000"
           send "&aVous avez reçu votre salaire !"
           set {salaire.%player%.lu} to now

Comment les mettre en mois ? Sinon skript pas mal !

Posté(e)
function getTimeLeft(diff: timespan, cooldown: timespan) :: string:
   subtract {_diff} from {_cooldown}
   set {_cooldown} to "%{_cooldown}%" parsed as string
   replace all "second" with "seconde" in {_cooldown}
   replace all "seconds" with "secondes" in {_cooldown}
   replace all "hour" with "heure" in {_cooldown}
   replace all "hours" with "heures" in {_cooldown}
   replace all "day" with "jour" in {_cooldown}
   replace all "days" with "jours" in {_cooldown}
   replace all "month" with "mois" in {_cooldown}
   replace all "months" with "mois" in {_cooldown}
   replace all "and" with "et" in {_cooldown}
   return {_cooldown}

command /salaire:
   trigger:
       if difference between now and {salaire.%player%.lu} is less than 1 month:
           send "&cPatiente encore &b%getTimeLeft(difference between now and {salaire.%player%.lu}, 1 month)% &c!"
       else:
           execute console command "/eco give %player% 6000"
           send "&aVous avez reçu votre salaire !"
           set {salaire.%player%.lu} to now

Posté(e)
function getTimeLeft(diff: timespan, cooldown: timespan) :: string:
   subtract {_diff} from {_cooldown}
   set {_cooldown} to "%{_cooldown}%" parsed as string
   replace all "second" with "seconde" in {_cooldown}
   replace all "seconds" with "secondes" in {_cooldown}
   replace all "hour" with "heure" in {_cooldown}
   replace all "hours" with "heures" in {_cooldown}
   replace all "day" with "jour" in {_cooldown}
   replace all "days" with "jours" in {_cooldown}
   replace all "month" with "mois" in {_cooldown}
   replace all "months" with "mois" in {_cooldown}
   replace all "and" with "et" in {_cooldown}
   return {_cooldown}

command /salaire:
   trigger:
       if difference between now and {salaire.%player%.lu} is less than 1 month:
           send "&cPatiente encore &b%getTimeLeft(difference between now and {salaire.%player%.lu}, 1 month)% &c!"
       else:
           execute console command "/eco give %player% 6000"
           send "&aVous avez reçu votre salaire !"
           set {salaire.%player%.lu} to now

1 month n'existe pas, la durée maximal du système de temps de Skript (Timer Span) est de 25 days.

Posté(e)
function getTimeLeft(diff: timespan, cooldown: timespan) :: string: subtract {_diff} from {_cooldown} set {_cooldown} to "%{_cooldown}%" parsed as string replace all "second" with "seconde" in {_cooldown} replace all "seconds" with "secondes" in {_cooldown} replace all "hour" with "heure" in {_cooldown} replace all "hours" with "heures" in {_cooldown} replace all "day" with "jour" in {_cooldown} replace all "days" with "jours" in {_cooldown} replace all "month" with "mois" in {_cooldown} replace all "months" with "mois" in {_cooldown} replace all "and" with "et" in {_cooldown} return {_cooldown} command /salaire: trigger: if difference between now and {salaire.%player%.lu} is less than 1 month: send "&cPatiente encore &b%getTimeLeft(difference between now and {salaire.%player%.lu}, 1 month)% &c!" else: execute console command "/eco give %player% 6000" send "&aVous avez reçu votre salaire !" set {salaire.%player%.lu} to now

Non ça marche pas :d Merci de ton aide comme meme

Posté(e)

Moua c'est sur mon compte Bancaire qu'il faudra envoyer la tune :p:p:p

 

Je peut te faire un Système de Salaire mais...

en jours réel et qui ne serait perçue qu'une seule fois à la connexion

si le joueur ne se connecte pas au moins une fois le jour TRUCMUCHE il ne perçois pas de Salaire pour le jour TRUCMUCHE

 

mais ATTENTION moua je Skript à mon rythme donc si je m'engage et que tu me met la pression, adieu ;)

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