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"
- if arg 1 is "Yellow":
- set {Equipe::%arg-player%} to "Yellow"
- set arg-player tab name to "&9%arg-player%"
- #FLECHE
- add 1 to {Fleche.Yellow.NB}
- set {Fleche.Yellow.%{Fleche.Yellow.NB}%} to arg-player
- send "&9%arg-player%&f est désormais dans l'équipe &6Jaune"
- if arg 1 is "Green":
- set {Equipe::%arg-player%} to "Green"
- set arg-player tab name to "&9%arg-player%"
- #FLECHE
- add 1 to {Fleche.Green.NB}
- set {Fleche.Green.%{Fleche.Green.NB}%} to arg-player
- send "&9%arg-player%&f est désormais dans l'équipe &aVerte"
- 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}
- set {Fleche.Yellow.NB} to 0
- clear {Fleche.Yellow.1}
- clear {Fleche.Yellow.2}
- clear {Fleche.Yellow.3}
- clear {Fleche.Yellow.4}
- set {Fleche.Green.NB} to 0
- clear {Fleche.Green.1}
- clear {Fleche.Green.2}
- clear {Fleche.Green.3}
- clear {Fleche.Green.4}
- send "&2&lOK ! :)"
- every 10 ticks:
- make all players execute command "/timermaj"
- every 1 second:
- if {CaughtCastle.isStart} is set:
- if {CaughtCastle.isPaused} is not set:
- add 1 to {CaughtCastle.Time.S}
- if {CaughtCastle.Time.S} is more than or equal to 60:
- set {CaughtCastle.Time.S} to 0
- add 1 to {CaughtCastle.Time.M}
- if {CaughtCastle.Time.M} is 19:
- if {CaughtCastle.Time.S} is 30:
- broadcast "&7Le soleil est entrain de se lever..."
- if {CaughtCastle.Time.M} is 20:
- add 1 to {CaughtCastle.Jour}
- broadcast "&3Caught Castle - Jour %{CaughtCastle.Jour}%"
- set {CaughtCastle.Time.M} to 0
- set {CaughtCastle.Time.S} to 0
- execute console command "/infoj"
- command /timermaj:
- trigger:
- erase player's sidebar
- if {CaughtCastle.isStart} is set:
- if {CaughtCastle.Time.S} is less than 10:
- set name of sidebar of player to "Jour %{CaughtCastle.Jour}% - %{CaughtCastle.Time.M}%:0%{CaughtCastle.Time.S}%"
- if {CaughtCastle.Time.M} is less than 10:
- set name of sidebar of player to "Jour %{CaughtCastle.Jour}% - 0%{CaughtCastle.Time.M}%:0%{CaughtCastle.Time.S}%"
- else:
- if {CaughtCastle.Time.M} is less than 10:
- if {CaughtCastle.Time.S} is more than or equal to 10:
- set name of sidebar of player to "Jour %{CaughtCastle.Jour}% - 0%{CaughtCastle.Time.M}%:%{CaughtCastle.Time.S}%"
- else:
- set name of sidebar of player to "Jour %{CaughtCastle.Jour}% - %{CaughtCastle.Time.M}%:%{CaughtCastle.Time.S}%"
- # set score " " in sidebar of player to -1
- set {_equipe} to {Equipe::%player%} #On récupère l équipe du joueur
- loop {ArrowDistance.%{_equipe}%.NB} times: #On loop autant de fois qu il y a de joueurs dans l équipe
- set {_player} to {ArrowDistance.%{_equipe}%.%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:
- 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 "%{_fleche.color}%%{_fleche}% &a%{_player}%" 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