Aller au contenu
  • 0

Problème Variable avec Argent


Question

Posté(e)

Bonjour à tous,

J'ai une pvpbox et j'ai un problème, quand un joueur mourrait de Feu / Vide ou autre, l'attacker ne recevait pas les coins bonus car cela détectait pas qu'il était l'attacker.

J'ai réussi à détecter l'attacker en créant une variable {tueur} (Voir Code)

Le problème maintenant c'est que je ne n'arrive pas à donner l'argent au {tueur}.

 

on death of player:
   if player's world is "pvpbox":
       heal victim
       teleport victim to {lobby.pvpbox}
       if {tueur} is a player:
           add 1 to {coins.%UUID of attacker%}
           add 1 to {kills.%uuid of attacker%}
           add 1 to {killstreak.%uuid of attacker%}
           add 1 to {morts.%uuid of victim%}
           send message "{@prefixpvpita} &8&oTu as tué %victim%" to attacker
           send message "{@prefixpvpita} &8&oTu as tué %victim%" to {tueur}
           send message "{@prefixpvpita} &8&o%{tueur}% vous a tué" to victim
           if {killstreak.%uuid of attacker%} > {best.killstreak.%uuid of attacker%}:
               set {best.killstreak.%uuid of attacker%} to {killstreak.%uuid of attacker%}
           if {killstreak.%uuid of victim%} > 4:
               broadcast "%attacker% a mis fin à la série de %victim% ! (%{killstreak.%uuid of victim%}%)"
           if {killstreak.%uuid of attacker%} is 5:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &65&c kills !"
               add 5 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+5 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 10:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &610&c kills !"
               add 10 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+10 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 15:
               add 1 to {killsteak.%attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &615&c kills !"
               add 15 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+15 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 20:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &620&c kills !"
               add 20 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+20 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 25:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &625&c kills !"
               add 25 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+25 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 30:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &630&c kills !"
               add 30 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+30 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
       else:
           send message "{@prefixpvpita} &8&oTu es mort tout seul" to victim
on damage:
   if attacker is a player:
       if victim is a player:
           set {tueur} to attacker
           set {victim} to victim
           message "Tu es attacker" to {tueur}
on death of player:
   if victim is {victim}:
       clear {tueur}
       clear {victim}

 

Je vous ai passé tout le code, mais la plus grande partie ne sert qu'aux killstreaks.

 

Dans le cas présent pour donner l'argent je fais ça : "add 1 to {coins.%UUID of attacker%}" sauf que l'argent est give à l"attacker" et non au "{tueur}". J'ai essayé "add 1 to {coins.%UUID of {tueur}%} mais ne fonctionne pas :/

 

Merci d'avance et redites moi si je ne suis pas clair ^^

12 réponses à cette question

Messages recommandés

  • 0
Posté(e)
Bonjour à tous,

J'ai une pvpbox et j'ai un problème, quand un joueur mourrait de Feu / Vide ou autre, l'attacker ne recevait pas les coins bonus car cela détectait pas qu'il était l'attacker.

J'ai réussi à détecter l'attacker en créant une variable {tueur} (Voir Code)

Le problème maintenant c'est que je ne n'arrive pas à donner l'argent au {tueur}.

 

on death of player:
   if player's world is "pvpbox":
       heal victim
       teleport victim to {lobby.pvpbox}
       if {tueur} is a player:
           add 1 to {coins.%UUID of attacker%}
           add 1 to {kills.%uuid of attacker%}
           add 1 to {killstreak.%uuid of attacker%}
           add 1 to {morts.%uuid of victim%}
           send message "{@prefixpvpita} &8&oTu as tué %victim%" to attacker
           send message "{@prefixpvpita} &8&oTu as tué %victim%" to {tueur}
           send message "{@prefixpvpita} &8&o%{tueur}% vous a tué" to victim
           if {killstreak.%uuid of attacker%} > {best.killstreak.%uuid of attacker%}:
               set {best.killstreak.%uuid of attacker%} to {killstreak.%uuid of attacker%}
           if {killstreak.%uuid of victim%} > 4:
               broadcast "%attacker% a mis fin à la série de %victim% ! (%{killstreak.%uuid of victim%}%)"
           if {killstreak.%uuid of attacker%} is 5:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &65&c kills !"
               add 5 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+5 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 10:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &610&c kills !"
               add 10 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+10 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 15:
               add 1 to {killsteak.%attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &615&c kills !"
               add 15 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+15 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 20:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &620&c kills !"
               add 20 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+20 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 25:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &625&c kills !"
               add 25 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+25 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 30:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &630&c kills !"
               add 30 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+30 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
       else:
           send message "{@prefixpvpita} &8&oTu es mort tout seul" to victim
on damage:
   if attacker is a player:
       if victim is a player:
           set {tueur} to attacker
           set {victim} to victim
           message "Tu es attacker" to {tueur}
on death of player:
   if victim is {victim}:
       clear {tueur}
       clear {victim}

 

Je vous ai passé tout le code, mais la plus grande partie ne sert qu'aux killstreaks.

 

Dans le cas présent pour donner l'argent je fais ça : "add 1 to {coins.%UUID of attacker%}" sauf que l'argent est give à l"attacker" et non au "{tueur}". J'ai essayé "add 1 to {coins.%UUID of {tueur}%} mais ne fonctionne pas :/

 

Merci d'avance et redites moi si je ne suis pas clair ^^

Bonjour à tous,

J'ai une pvpbox et j'ai un problème, quand un joueur mourrait de Feu / Vide ou autre, l'attacker ne recevait pas les coins bonus car cela détectait pas qu'il était l'attacker.

J'ai réussi à détecter l'attacker en créant une variable {tueur} (Voir Code)

Le problème maintenant c'est que je ne n'arrive pas à donner l'argent au {tueur}.

 

on death of player:
   if player's world is "pvpbox":
       heal victim
       teleport victim to {lobby.pvpbox}
       if {tueur} is a player:
           add 1 to {coins.%UUID of attacker%}
           add 1 to {kills.%uuid of attacker%}
           add 1 to {killstreak.%uuid of attacker%}
           add 1 to {morts.%uuid of victim%}
           send message "{@prefixpvpita} &8&oTu as tué %victim%" to attacker
           send message "{@prefixpvpita} &8&oTu as tué %victim%" to {tueur}
           send message "{@prefixpvpita} &8&o%{tueur}% vous a tué" to victim
           if {killstreak.%uuid of attacker%} > {best.killstreak.%uuid of attacker%}:
               set {best.killstreak.%uuid of attacker%} to {killstreak.%uuid of attacker%}
           if {killstreak.%uuid of victim%} > 4:
               broadcast "%attacker% a mis fin à la série de %victim% ! (%{killstreak.%uuid of victim%}%)"
           if {killstreak.%uuid of attacker%} is 5:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &65&c kills !"
               add 5 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+5 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 10:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &610&c kills !"
               add 10 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+10 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 15:
               add 1 to {killsteak.%attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &615&c kills !"
               add 15 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+15 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 20:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &620&c kills !"
               add 20 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+20 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 25:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &625&c kills !"
               add 25 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+25 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 30:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &630&c kills !"
               add 30 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+30 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
       else:
           send message "{@prefixpvpita} &8&oTu es mort tout seul" to victim
on damage:
   if attacker is a player:
       if victim is a player:
           set {tueur} to attacker
           set {victim} to victim
           message "Tu es attacker" to {tueur}
on death of player:
   if victim is {victim}:
       clear {tueur}
       clear {victim}

 

Je vous ai passé tout le code, mais la plus grande partie ne sert qu'aux killstreaks.

 

Dans le cas présent pour donner l'argent je fais ça : "add 1 to {coins.%UUID of attacker%}" sauf que l'argent est give à l"attacker" et non au "{tueur}". J'ai essayé "add 1 to {coins.%UUID of {tueur}%} mais ne fonctionne pas :/

 

Merci d'avance et redites moi si je ne suis pas clair ^^

Essaye add 1 to {coins.%{tueur}%}

  • 0
Posté(e)

Pour faire ceci, il suffit de faire ça :

 

on damage:
   victim is a player
   attacker is a player
   set {last.attacker.%victim%} to "%attacker%" parsed as player

# Maintenant la variable {last.attacker.%player%} contiendra le dernier attaquant.

on death:
   damage cause is burning:
       set death message to ""
       broadcast "%player% a été tué par %{last.attacker.%player%}% !"
       # Maintenant tu fais tes trucs avec tes variables
       add 2 to {coins.%{last.attacker.%player%}%}

# Etc...

 

Désolé si y a des erreurs j'ai fait ça sur téléphone ^_^ !

  • 0
Posté(e)

options:
   prefixscita:&7&o[&9&l&oSela&e&l&oCoins&7&o]&b
   prefixpvp: &4[&6PVP&7-&6BOX&4]
   prefixpvpita: &4&o[&6&oPVP&7&o-&6&oBOX&4&o]

command /setlobby <text>:
   permission: pvpbox.sk
   trigger:
       if arg 1 is "pvpbox":
           set {lobby.pvpbox} to location of player
           message "Lobby PvPBox SET !"

command /statistiques:
   usage: &cUtilise &e/stats &cpour visionné tes statistiques
   trigger:
       message "&8╔══════════[ &cStatistiques ]&8══════════╗"
       message "&7➜ &c&nKills :&7 %{kills.%{last.attacker.%player%}%}%"
       message ""
       message "&7➜ &c&nMorts :&7 %{morts.%{last.attacker.%player%}%}%"
       message ""
       message "&7➜ &c&nBest KillStreak :&7 %{best.killstreak.%uuid of player%}%"
       message "&8╚══════════[ &cStatistiques &8]══════════╝"

on join:
   if {best.killstreak.%uuid of player%} is not set:
       set {best.killstreak.%uuid of player%} to 0
   if {killstreak.%uuid of player%} is not set:
       set {killstreak.%uuid of player%} to 0
   if {kills.%uuid of player%} is not set:
       set {kills.%uuid of player%} to 0
   if {morts.%uuid of player%} is not set:
       set {morts.%uuid of player%} to 0

on death of player:
   if player's world is "pvpbox":
       heal victim
       teleport victim to {lobby.pvpbox}
       if {last.attacker.%player%} is a player:
           add 1 to {coins.%{last.attacker.%attacker%}%}
           add 1 to {kills.%{last.attacker.%attacker%}%}
           add 1 to {killstreak.%{last.attacker.%attacker%}%}
           add 1 to {morts.%{last.attacker.%victim%}%}
           set {killstreak.%{last.attacker.%victim%}%} to 0
           broadcast "%player% a été tué par %{last.attacker.%player%}% !"
           send message "{@prefixpvpita} &8&oTu as tué %player%" to {last.attacker.%player%}
           send message "{@prefixpvpita} &8&o%{last.attacker.%player%}% vous a tué" to player
           if {killstreak.%{last.attacker.%player%}%} > {best.killstreak.%{last.attacker.%player%}%}:
               set {best.killstreak.%{last.attacker.%player%}%} to {killstreak.%{last.attacker.%player%}%}
           if {killstreak.%uuid of victim%} > 4:
               broadcast "%attacker% a mis fin à la série de %victim% ! (%{killstreak.%uuid of victim%}%)"
           if {killstreak.%uuid of attacker%} is 5:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &65&c kills !"
               add 5 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+5 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 10:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &610&c kills !"
               add 10 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+10 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 15:
               add 1 to {killsteak.%attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &615&c kills !"
               add 15 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+15 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 20:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &620&c kills !"
               add 20 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+20 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 25:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &625&c kills !"
               add 25 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+25 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
           if {killstreak.%uuid of attacker%} is 30:
               add 1 to {killsteak.%uuid of attacker%}
               broadcast "{@prefixpvp} &6%attacker%&c est en série de &630&c kills !"
               add 30 to {coins.%UUID of attacker%}
               send message "{@prefixscita} &e&o+30 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
               stop
       else:
           send message "{@prefixpvpita} &8&oTu es mort tout seul" to victim
on damage:
   victim is a player
   attacker is a player
   set {last.attacker.%victim%} to "%attacker%" parsed as player

 

Le problème c'est que quand je tue quelqu'un je reçois également la mort, il faut crée une autre variable pour la victime ?

Et je comprends pas pq dans la variable "{last.attacker.%victim%}" tu as mis victim si c'est pour l'attacker ^^

  • 0
Posté(e)

Demande traitée !

 

Nom du script : PvP-Box - Morts

 

Description du script :

 

Quand un joueur meurt, il se fera automatiquement tué par le dernier joueur qui l'a tapé.

Par manque de temps, je n'ai pas pu faire le système de KillsStreak ): !

 

Commandes :

 

> Aucune...

 

Configuration du script :

 

[spoiler=Configuration]

    Prefix: &8[&aPvP-Box&8]

   Message_Kill: &aVous avez tué le joueur &e{PLAYER} &a!
   Message_Mort: &aVous avez été tué par &e{PLAYER} &a!

   Mort_Tout_Seul: &aTu t'es suicidé...

 

 

 

> Une erreur ? Poste une image de tes erreurs avec ta version MC, Bukkit ou Spigot, et tes ADD-ON !

 

> Skript & ADD-ON ? Télécharge le tout ici !

 

> Utile pour toi ? Lâche un "J'aime" !

  • J'aime 1
  • 0
Posté(e)

Merci beaucoup de prendre du temps pour m'aider :) !

Tu as testé le skript ? Ca ne fonctionne pas de mon côté :/ ça indique tu t'es suicidé quand on meurt, et si on fait un kill il ne ce passe rien :/

Les stats ne changent pas non plus

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