Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /team [<text>] [<player>]:
- trigger:
- if arg 1 is "Blue":
- set {Equipe::%arg-player%} to "Blue"
- set arg-player tab name to "&9%arg-player%"
- #FLECHE
- add 1 to {Fleche.Blue.NB}
- set {Fleche.Blue.%{Fleche.Blue.NB}%} to arg-player
- send "&9%arg-player%&f est désormais dans l'équipe &9Bleue"
- command /reset:
- trigger:
- clear {Equipe::*}
- set {Fleche.Blue.NB} to 0
- clear {Fleche.Blue.1}
- clear {Fleche.Blue.2}
- clear {Fleche.Blue.3}
- clear {Fleche.Blue.4}
- send "&2&lOK ! :)"
- command /info:
- trigger:
- send "%{Fleche.Blue.NB}%"
- send "%{Fleche.Blue.1}%"
- send "%{Fleche.Blue.2}%"
- every 1 seconds:
- make all players execute command "/timermaj"
- command /timermaj:
- trigger:
- display board named "" to player
- set name of sidebar of player to " &3Jeu &bI "
- set score " " in sidebar of player to 5
- set {_equipe} to {Equipe::%player%} #On récupère l équipe du joueur
- loop {Fleche.%{_equipe}%.NB} times: #On loop autant de fois qu il y a de joueurs dans l équipe
- set {_player} to {Fleche.Blue.%loop-number%} #On récupère le joueur "loopé"
- {_player} is not player #Si le joueur "loopé" n est pas le joueur qui actualise son scoreboard
- {_player} is online #Si la personne est bien en ligne
- set {_coordx1} to x-position of player #On récupère diverses infos
- set {_coordx2} to x-position of {_player}
- set {_distx} to {_coordx2}-{_coordx1}
- set {_coordz1} to z-position of player
- set {_coordz2} to z-position of {_player}
- set {_distz} to {_coordz2}-{_coordz1}
- set {_distxz} to sqrt of ({_distx}^2+{_distz}^2)
- set {_cosangle} to {_distx} / {_distxz}
- set {_sinangle} to {_distz} / {_distxz}
- if distance between player and {_player} is less than or equal to 50: #Ton morceau de code
- set {_fleche.color} to "&b&l"
- else if distance between player and {_player} is more than or equal to 50: #J ai modifié le nombre car ne prenait pas en compte de 50 à 100
- set {_fleche.color} to "&9&l"
- if distance between player and {_player} is more than or equal to 200:
- set {_fleche.color} to "&c&l"
- if distance between player and {_player} is more than or equal to 350:
- set {_fleche.color} to "&4&l"
- if {_cosangle} is between -1 and -0.7: #On attribue une valeur à chaque direction (0=N, 1=E, 2=S, 3=O)
- set {_direction} to 3
- else if {_cosangle} is between 0.7 and 1:
- set {_direction} to 1
- else if {_sinangle} is between 0.7 and 1:
- set {_direction} to 2
- else:
- set {_direction} to 0
- if horizontal facing of player is east: #On met un décalage en fonction de la direction du joueur
- remove 1 from {_direction}
- else if horizontal facing of player is south:
- remove 2 from {_direction}
- else if horizontal facing of player is west:
- remove 3 from {_direction}
- if {_direction} is smaller than 0:
- add 4 to {_direction}
- if {_direction} is 0: #On attribue une flèche
- set {_fleche} to "^"
- else if {_direction} is 1:
- set {_fleche} to ">"
- else if {_direction} is 2:
- set {_fleche} to "v"
- else if {_direction} is 3:
- set {_fleche} to "<"
- set score "%{_player}% %{_fleche.color}%%{_fleche}%" in sidebar of player to loop-number #On affiche la flèche avec le joueur approprié
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement