Aller au contenu

Limiter l'utilisation d'une commande


Messages recommandés

Posté(e)

Bonjour à tous,

 

Je cherche un moyen de limiter l'utilisation des commandes sur mon serveur, que sa soit par exemple réglé l'utilisation du /repair ou bloquer le spam de /tpa (le limiter a une utilisation toutes les 15 secondes par exemple) cela me serai très utile mais je ne sais pas m'y prendre , si quelqu'un est en meusure de m'aider sa serais gentil , et si possible m'expliqué brièvement comment ça marche ;)

 

Merci à vous !

Posté(e)
variables:
   {limite.command.%player%}: false

On command /tpa:
   if {limite.command.%player%} is true:
       cancel event
       send "&4La commande est sous un délai de 15 secondes pour eviter le spam de la commande !"
   if {limite.command.%player%} is false:
       stop
       set {limite.command.%player%} to true
       wait 15 seconds
       set {limite.command.%player%} to false

Posté(e)

Essaie ca , j ai sans faire exprès rajouter la ligne "stop" é_è

variables:
   {limite.command.%player%}: false

On command /tpa:
   if {limite.command.%player%} is true:
       cancel event
       send "&4La commande est sous un délai de 15 secondes pour eviter le spam de la commande !"
   if {limite.command.%player%} is false:
       set {limite.command.%player%} to true
       wait 15 seconds
       set {limite.command.%player%} to false

Posté(e)

je regarde mais y a t'il un moyen que sa note le temps qu'il faut attendre avant de pouvoir réutiliser la commande?

Car je vai l'utiliser pour d'autres commandes sa serais pratique et esthétique :3

Posté(e)

Je te laisse faire le système du tp ^^

variables:
   {limite.command.%player%} = 0

On command /tpa [<player>]:
   if arg 1 is set:
       if {limite.command.%player%} > 0:
           cancel event
           send "&cMerci de patienter encore %{limite.command.%player%}% secondes s'il vous plaît."
       if {limite.command.%player%} = 0:
           set {limite.command.%player%} to 15
           wait 1 second
           set {limite.command.%player%} to 14
           wait 1 second
           set {limite.command.%player%} to 13
           wait 1 second
           set {limite.command.%player%} to 12
           wait 1 second
           set {limite.command.%player%} to 11
           wait 1 second
           set {limite.command.%player%} to 10
           wait 1 second
           set {limite.command.%player%} to 9
           wait 1 second
           set {limite.command.%player%} to 8
           wait 1 second
           set {limite.command.%player%} to 7
           wait 1 second
           set {limite.command.%player%} to 6
           wait 1 second
           set {limite.command.%player%} to 5
           wait 1 second
           set {limite.command.%player%} to 4
           wait 1 second
           set {limite.command.%player%} to 3
           wait 1 second
           set {limite.command.%player%} to 2
           wait 1 second
           set {limite.command.%player%} to 1
           wait 1 second
           set {limite.command.%player%} to 0
           send "&aTu peux réutiliser la commande: /tpa"

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