Guest User

Untitled

a guest
Feb 11th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.73 KB | None | 0 0
  1. command /team [<text>] [<player>]:
  2.     trigger:
  3.         if arg 1 is "Blue":
  4.             set {Equipe::%arg-player%} to "Blue"
  5.             set arg-player tab name to "&9%arg-player%"
  6.            
  7.             #FLECHE
  8.             add 1 to {Fleche.Blue.NB}
  9.             set {Fleche.Blue.%{Fleche.Blue.NB}%} to arg-player
  10.            
  11.             send "&9%arg-player%&f est désormais dans l'équipe &9Bleue"
  12.         if arg 1 is "Yellow":
  13.             set {Equipe::%arg-player%} to "Yellow"
  14.             set arg-player tab name to "&9%arg-player%"
  15.            
  16.             #FLECHE
  17.             add 1 to {Fleche.Yellow.NB}
  18.             set {Fleche.Yellow.%{Fleche.Yellow.NB}%} to arg-player
  19.            
  20.             send "&9%arg-player%&f est désormais dans l'équipe &6Jaune"
  21.         if arg 1 is "Green":
  22.             set {Equipe::%arg-player%} to "Green"
  23.             set arg-player tab name to "&9%arg-player%"
  24.            
  25.             #FLECHE
  26.             add 1 to {Fleche.Green.NB}
  27.             set {Fleche.Green.%{Fleche.Green.NB}%} to arg-player
  28.            
  29.             send "&9%arg-player%&f est désormais dans l'équipe &aVerte"
  30.            
  31.            
  32. command /reset:
  33.     trigger:
  34.         clear {Equipe::*}
  35.         set {Fleche.Blue.NB} to 0
  36.         clear {Fleche.Blue.1}
  37.         clear {Fleche.Blue.2}
  38.         clear {Fleche.Blue.3}
  39.         clear {Fleche.Blue.4}
  40.        
  41.         set {Fleche.Yellow.NB} to 0
  42.         clear {Fleche.Yellow.1}
  43.         clear {Fleche.Yellow.2}
  44.         clear {Fleche.Yellow.3}
  45.         clear {Fleche.Yellow.4}
  46.        
  47.         set {Fleche.Green.NB} to 0
  48.         clear {Fleche.Green.1}
  49.         clear {Fleche.Green.2}
  50.         clear {Fleche.Green.3}
  51.         clear {Fleche.Green.4}
  52.         send "&2&lOK ! :)"
  53.        
  54.            
  55. every 10 ticks:
  56.     make all players execute command "/timermaj"
  57.  
  58. every 1 second:
  59.     if {CaughtCastle.isStart} is set:
  60.         if {CaughtCastle.isPaused} is not set:
  61.             add 1 to {CaughtCastle.Time.S}
  62.             if {CaughtCastle.Time.S} is more than or equal to 60:
  63.                 set {CaughtCastle.Time.S} to 0
  64.                 add 1 to {CaughtCastle.Time.M}
  65.         if {CaughtCastle.Time.M} is 19:
  66.             if {CaughtCastle.Time.S} is 30:
  67.                 broadcast "&7Le soleil est entrain de se lever..."
  68.         if {CaughtCastle.Time.M} is 20:
  69.             add 1 to {CaughtCastle.Jour}
  70.             broadcast "&3Caught Castle - Jour %{CaughtCastle.Jour}%"
  71.             set {CaughtCastle.Time.M} to 0
  72.             set {CaughtCastle.Time.S} to 0
  73.             execute console command "/infoj"
  74.  
  75. command /timermaj:
  76.     trigger:
  77.         erase player's sidebar
  78.         if {CaughtCastle.isStart} is set:
  79.             if {CaughtCastle.Time.S} is less than 10:
  80.                 set name of sidebar of player to "Jour %{CaughtCastle.Jour}% - %{CaughtCastle.Time.M}%:0%{CaughtCastle.Time.S}%"
  81.                 if {CaughtCastle.Time.M} is less than 10:
  82.                     set name of sidebar of player to "Jour %{CaughtCastle.Jour}% - 0%{CaughtCastle.Time.M}%:0%{CaughtCastle.Time.S}%"
  83.             else:
  84.                 if {CaughtCastle.Time.M} is less than 10:
  85.                     if {CaughtCastle.Time.S} is more than or equal to 10:
  86.                         set name of sidebar of player to "Jour %{CaughtCastle.Jour}% - 0%{CaughtCastle.Time.M}%:%{CaughtCastle.Time.S}%"
  87.                     else:
  88.                         set name of sidebar of player to "Jour %{CaughtCastle.Jour}% - %{CaughtCastle.Time.M}%:%{CaughtCastle.Time.S}%"
  89.         #   set score " " in sidebar of player to -1
  90.             set {_equipe} to {Equipe::%player%} #On récupère l équipe du joueur
  91.             loop {ArrowDistance.%{_equipe}%.NB} times: #On loop autant de fois qu il y a de joueurs dans l équipe
  92.                 set {_player} to {ArrowDistance.%{_equipe}%.%loop-number%} #On récupère le joueur "loopé"
  93.                 {_player} is not player #Si le joueur "loopé" n est pas le joueur qui actualise son scoreboard
  94.                 {_player} is online #Si la personne est bien en ligne
  95.                
  96.                 set {_coordx1} to x-position of player #On récupère diverses infos
  97.                 set {_coordx2} to x-position of {_player}
  98.                 set {_distx} to {_coordx2}-{_coordx1}
  99.                 set {_coordz1} to z-position of player
  100.                 set {_coordz2} to z-position of {_player}
  101.                 set {_distz} to {_coordz2}-{_coordz1}
  102.                 set {_distxz} to sqrt of ({_distx}^2+{_distz}^2)
  103.                 set {_cosangle} to {_distx} / {_distxz}
  104.                 set {_sinangle} to {_distz} / {_distxz}
  105.                
  106.                 if distance between player and {_player} is less than or equal to 50:
  107.                     set {_fleche.color} to "&b&l"
  108.                 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
  109.                     set {_fleche.color} to "&9&l"
  110.                 if distance between player and {_player} is more than or equal to 200:
  111.                     set {_fleche.color} to "&c&l"
  112.                 if distance between player and {_player} is more than or equal to 350:
  113.                     set {_fleche.color} to "&4&l"
  114.                    
  115.                 if {_cosangle} is between -1 and -0.7: #On attribue une valeur à chaque direction (0=N, 1=E, 2=S, 3=O)
  116.                     set {_direction} to 3
  117.                 else if {_cosangle} is between 0.7 and 1:
  118.                     set {_direction} to 1
  119.                 else if {_sinangle} is between 0.7 and 1:
  120.                     set {_direction} to 2
  121.                 else:
  122.                     set {_direction} to 0
  123.                    
  124.                 if horizontal facing of player is east: #On met un décalage en fonction de la direction du joueur
  125.                     remove 1 from {_direction}
  126.                 else if horizontal facing of player is south:
  127.                     remove 2 from {_direction}
  128.                 else if horizontal facing of player is west:
  129.                     remove 3 from {_direction}
  130.                    
  131.                 if {_direction} is smaller than 0:
  132.                     add 4 to {_direction}
  133.  
  134.                 if {_direction} is 0: #On attribue une flèche
  135.                     set {_fleche} to "^"
  136.                 else if {_direction} is 1:
  137.                     set {_fleche} to ">"
  138.                 else if {_direction} is 2:
  139.                     set {_fleche} to "v"
  140.                 else if {_direction} is 3:
  141.                     set {_fleche} to "<"
  142.                
  143.                 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