Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.01 KB | None | 0 0
  1.     // Equilibrage des scouts
  2.     $skillarray = $playerskills['scout'];
  3.     $max = -1;
  4.     $bluSkill = 0;
  5.     $redSkill = 0;
  6.    
  7.     $scoutchk = array($playerlist['scout'][0] => 0, $playerlist['scout'][1] => 0, $playerlist['scout'][2] => 0, $playerlist['scout'][3] => 0);
  8.    
  9.     for($i = 0; $i < 4; $i++) {
  10.         for($j = 0; $j < 4; $j++) {
  11.             if($skillarray[$j] > $max && $scoutchk[$playerlist['scout'][$j]] == 0) {
  12.                 echo "$ ".$j."-".$skillarray[$j]."<>".$max." skill ".$skillarray[$j]." $<br>";
  13.                 $max = $skillarray[$j];
  14.                 $iMax = $j;
  15.             }
  16.         }
  17.        
  18.         $scoutchk[$playerlist['scout'][$iMax]] = 1;
  19.        
  20.         if($i%2 == 0) {
  21.             $red['scout'][intval($i/2)] = $playerlist['scout'][$iMax];
  22.             $redSkill += $skillarray[$iMax];
  23.             $skillarray['scout'][$iMax] = -1;
  24.         }
  25.         else {
  26.             $blu['scout'][intval($i/2)] = $playerlist['scout'][$iMax];
  27.             $bluSkill += $skillarray[$iMax];
  28.             $skillarray['scout'][$iMax] = -1;
  29.         }
  30.        
  31.     $max = -1;
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement