Jump to content

Recommended Posts

When a loss is reported, it comes up with the wrong ranks for everyone. Not much more details then that.

 

I think its these lines doing it:

//FIND WINNERS NEW RANK

$totalranked=mysql_query("SELECT COUNT(*) FROM ladder_$ladder[id] WHERE rank > '0'");
$totalranked=mysql_fetch_array($totalranked);
$totalranked="$totalranked[0]";

$adjustranks="";

if($winner[rank] > 0){
if(($winner[rank] > $loser[rank]) && ($loser[rank] > 0)){
$middlerank=(($winner[rank] + $loser[rank]) - 0.5);
$new_winner_rank=round(($middlerank / 2) - 0.5);
$adjustranks=1;
}else{
$new_winner_rank="$winner[rank]";
}
}
else{
$new_winner_rank=($totalranked + 1);
$adjustranks=1;
}

 

 

But the whole file is:

<?
include("./config.php");

if ($login[id] && !is_numeric($login[id])) {
error("You have specified an Invalid Login ID!"); }

check_login($login);

switch($action){

case "reportloss":
report_loss($login);
break;

case "reportlossb":
check_loss($login);
break;

default:
check_login($login);
break;
}

function check_login($login){
global $config;

if(!mysql_num_rows(mysql_query("SELECT id FROM teams WHERE id='$login[id]' AND password='$login[pass]' OR id='$login[id]' AND reportpass='$login[pass]'"))){
$out[body].="
<center>
<table bgcolor='#000000' width='70%' cellspacing='1' cellpadding='1'>
<form method='post'>
<tr bgcolor='$config[altcolor]'>
<td background='$config[bg]' width='100%' valign='center' align='left' colspan='2'>
<strong><font face='verdana' color='#272828'>Report a Loss</strong>";
if($login[failreport]){
$out[body].=" <font color='#FF0000' size='1'>(Incorrect Login)</font>";
}
$out[body].="
</td>
</tr>
<tr bgcolor='$config[altcolora]'>
<td background='$config[tablex]' width='40%' valign='center' align='left'><font face='verdana' size='-2'><font color='#272828'>Account ID</td>
<td background='$config[tablex]' width='60%' valign='center' align='center'><input type='text' class='input' name='login[id]' value='$login[id]' size='25' maxlength='10'></td>
</tr>
<tr bgcolor='$config[altcolorb]'>
<td background='$config[tablex]' width='40%' valign='center' align='left'><font face='verdana' size='-2'><font color='#272828'>Password</td>
<td background='$config[tablex]' width='60%' valign='center' align='center'><input type='password' class='input' name='login[pass]' value='' size='25' maxlength='10'></td>
</tr>
<tr bgcolor='$config[altcolora]'>
<td background='$config[tablex]' width='40%' valign='center' align='left'><font face='verdana' size='-2'><font color='#272828'>Winner ID</td>
<td background='$config[tablex]' width='60%' valign='center' align='center'><input type='text' class='input' name='login[wid]' value='$login[wid]' size='25' maxlength='10'></td>
</tr>
<tr>
<td width='100%' valign='top' bgcolor='$config[altcolorb]' align='right' colspan='2'>
<input type='hidden' name='login[failreport]' value='1'>
<input type='hidden' name='action' value='reportloss'>
<input type='submit' name='submit' value='Report >>'></td>
</form>
</tr>
</table>
<br>
</center>";


include("$config[html]");
exit;
}
}


function report_loss($login){
global $config;

$losid="$login[id]";
$winid="$login[wid]";

if($login[id]=="$login[wid]"){
error("You cannot report losses to yourself.");
}

$challenges=mysql_query("SELECT challid,challgrid,challgdid FROM challenges WHERE challgrid='$login[id]' AND challgdid='$login[wid]' OR challgrid='$login[wid]' AND challgdid='$login[id]'");
$challenges=mysql_fetch_array($challenges);

$challid = $challenges['challid'];

$check=mysql_query("SELECT * FROM chall_chat WHERE chall_id='$challid'");
$check=mysql_fetch_array($check);

if ($check[ed_status]==Accepted OR $check[er_status]==Accepted){
$valid = true;
}else{
$valid = false; }

if ($challenges['challid'] == null OR !$valid){
error("Challenge does not exist or is not accepted."); }

$winnerteam=mysql_query("SELECT ladderid FROM teams WHERE id='$login[wid]'");
$winnerteam=mysql_fetch_array($winnerteam);

if(!$winnerteam[ladderid]){
error("Unable to find the winning team.");
}

$ladder=mysql_query("SELECT * FROM ladders WHERE id='$winnerteam[ladderid]'");
$ladder=mysql_fetch_array($ladder);

if(!$ladder[name]){
error("Unable to load the ladder information.");
}

$loser=mysql_query("SELECT * FROM ladder_$ladder[id] WHERE teamid='$login[id]'");
$loser=mysql_fetch_array($loser);

$winner=mysql_query("SELECT * FROM ladder_$ladder[id] WHERE teamid='$login[wid]'");
$winner=mysql_fetch_array($winner);

if(!$loser[name]){
error("Unable to find the losing teams stats.");
}

if(!$winner[name]){
error("Unable to find the winning teams stats.");
}


if($ladder[isteam]){
$members=mysql_query("SELECT id,name FROM members WHERE teamid='$login[id]' ORDER by joined");
while(list($id,$name)=mysql_fetch_row($members)){
if($config[altcolorx]==$config[altcolora]){
$config[altcolorx]="$config[altcolorb]";
}else{
$config[altcolorx]="$config[altcolora]";
}
$losmembers.="
<tr bgcolor='$config[altcolorx]'>
<td background='$config[tablex]' width='60%' valign='center' align='left'><font face='verdana' size='-2'><font color='#272828'>$name</b></td>
<td background='$config[tablex]' width='40%' valign='center' align='left'><font face='verdana' size='-2'><font color='#272828'>Kills:</b> <input type='text' class='input' name='login[member][$losid][$id]' value='' size='25' maxlength='2'></td>
</tr>";
}
}else{
$losmembers.="
<tr bgcolor='$config[altcolora]'>
<td background='$config[tablex]' width='60%' valign='center' align='left'><font face='verdana' size='-2'><font color='#272828'>Total Kills</b></td>
<td background='$config[tablex]' width='40%' valign='center' align='left'><font face='verdana' size='-2'><font color='#272828'>Kills:</b> <input type='text' class='input' name='login[totalkills][$losid]' value='' size='25' maxlength='2'></td>
</tr>";
}

if($ladder[isteam]){
$members=mysql_query("SELECT id,name FROM members WHERE teamid='$login[wid]' ORDER by joined");
while(list($id,$name)=mysql_fetch_row($members)){
if($config[altcolorx]==$config[altcolora]){
$config[altcolorx]="$config[altcolorb]";
}else{
$config[altcolorx]="$config[altcolora]";
}
$winmembers.="
<tr bgcolor='$config[altcolorx]'>
<td background='$config[tablex]' width='60%' valign='center' align='left'><font face='verdana' size='-2'><font color='#272828'>$name</b></td>
<td background='$config[tablex]' width='40%' valign='center' align='left'><font face='verdana' size='-2'><font color='#272828'>Kills:</b> <input type='text' class='input' name='login[member][$winid][$id]' value='' size='25' maxlength='2'></td>
</tr>";
}
}else{
$winmembers.="
<tr bgcolor='$config[altcolora]'>
<td background='$config[tablex]' width='60%' valign='center' align='left'><font face='verdana' size='-2'><font color='#272828'>Total Kills</b></td>
<td background='$config[tablex]' width='40%' valign='center' align='left'><font face='verdana' size='-2'><font color='#272828'>Kills:</b> <input type='text' class='input' name='login[totalkills][$winid]' value='' size='25' maxlength='2'></td>
</tr>";
}

if($ladder[isteam]){
$footmessage.="Only put kills for members who played.<br>";
}


$out[body].="
<br>
<center>
<table width='98%' bgcolor='#000000' border='0' cellspacing='1' cellpadding='1'>
<form method='post'>
<tr bgcolor='$config[altcolor]'>
<td background='$config[bg]' width='100%' valign='center' align='left' colspan='2'><font face='verdana' size='0'><font color='#272828'>Reporting Loss: $ladder[name]</td>
</tr>

<tr bgcolor='$config[altcolor]'>
<td background='$config[tablex]' width='100%' valign='center' align='left' colspan='2'><font face='verdana' size='-1'><font color='#272828'>$loser[name] Information (Loser)</td>
</tr>

$losmembers

<tr bgcolor='$config[altcolor]'>
<td background='$config[tablex]' width='100%' valign='center' align='left' colspan='2'><font face='verdana' size='-1'><font color='#272828'>$winner[name] Information (Winner)</td>
</tr>

$winmembers

<tr>
<td width='100%' valign='top' align='right' colspan='2'>

<input type='hidden' name='action' value='reportlossb'>
<input type='hidden' name='login[ladderid]' value='$ladder[id]'>
<input type='hidden' name='login[wid]' value='$login[wid]'>
<input type='hidden' name='login[id]' value='$login[id]'>
<input type='hidden' name='login[pass]' value='$login[pass]'>
<input type='submit' name='submit' value='Report Match >>'></td>
</form>
</tr>
</table>
<br>
<b>$footmessage</b>
<br>
</center>";

include("$config[html]");
}


function check_loss($login){
global $config;

$losid="$login[id]";
$winid="$login[wid]";

if($login[id]=="$login[wid]"){
error("You cannot report losses to yourself.");
}

$challenges=mysql_query("SELECT challid,challgrid,challgdid FROM challenges WHERE challgrid='$login[id]' AND challgdid='$login[wid]' OR challgrid='$login[wid]' AND challgdid='$login[id]'");
$challenges=mysql_fetch_array($challenges);

$challid = $challenges['challid'];

$check=mysql_query("SELECT * FROM chall_chat WHERE chall_id='$challid'");
$check=mysql_fetch_array($check);

if ($check[ed_status]==Accepted OR $check[er_status]==Accepted){
$valid = true;
}else{
$valid = false; }

if ($challenges['challid'] == null OR !$valid){
error("Challenge does not exist or is not accepted."); }

$ladder=mysql_query("SELECT * FROM ladders WHERE id='$login[ladderid]'");
$ladder=mysql_fetch_array($ladder);

if(!$ladder[name]){
error("Unable to load the ladder information.");
}

$loser=mysql_query("SELECT * FROM ladder_$ladder[id] WHERE teamid='$login[id]'");
$loser=mysql_fetch_array($loser);

$winner=mysql_query("SELECT * FROM ladder_$ladder[id] WHERE teamid='$login[wid]'");
$winner=mysql_fetch_array($winner);

if(!$loser[name]){
error("Unable to find the losing teams stats.");
}

if(!$winner[name]){
error("Unable to find the winning teams stats.");
}



//UPDATE LOSING TEAM

$new_loser_rank="$loser[rank]";
$new_loser_lrank="$loser[rank]";
$new_loser_wins="$loser[wins]";
$new_loser_loss=($loser[loss] + 1);
$new_loser_games=($loser[games] + 1);
$new_loser_percent=round($loser[wins] / $new_loser_games * 100);
$new_loser_streak=($loser[streak] - 1);

if($new_loser_streak >= 0){
$new_loser_streak="-1";
}

// Winners & Losers New Points & Level

$level_diff=($winner[level] - $loser[level]);

if ($level_diff <= "-1"){
	$level_diff=str_replace("-", "", "$level_diff");

if ($level_diff == 0){
$new_winner_points="100";
$new_loser_points="100";
}

if ($level_diff == 1){

if ($winner[level] > $loser[level]){
	$new_winner_points="90";
	$new_loser_points="90";
	}
		else	
{
$new_winner_points="120";
$new_loser_points="110";
  }		
}

if ($level_diff == 2){
if ($winner[level] > $loser[level]){
	$new_winner_points="80";
	$new_loser_points="80";
	}
		else	
{
$new_winner_points="140";
$new_loser_points="120";
  }	
}

if ($level_diff == 3){
if ($winner[level] > $loser[level]){
	$new_winner_points="70";
	$new_loser_points="70";
	}
		else	
{
$new_winner_points="160";
$new_loser_points="130";
  }
}

if ($level_diff == 4){
if ($winner[level] > $loser[level]){
	$new_winner_points="60";
	$new_loser_points="60";
	}
		else	
{
$new_winner_points="175";
$new_loser_points="140";
  }
}

if ($level_diff == 5){
if ($winner[level] > $loser[level]){
	$new_winner_points="50";
	$new_loser_points="50";
	}
		else	
{
$new_winner_points="190";
$new_loser_points="150";
  }
}

if ($level_diff == 6){
if ($winner[level] > $loser[level]){
	$new_winner_points="40";
	$new_loser_points="40";
	}
		else	
{
$new_winner_points="205";
$new_loser_points="160";
  }
}

if ($level_diff == 7){
if ($winner[level] > $loser[level]){
	$new_winner_points="30";
	$new_loser_points="30";
	}
		else	
{
$new_winner_points="215";
$new_loser_points="170";
  }
}

if ($level_diff == {
if ($winner[level] > $loser[level]){
	$new_winner_points="20";
	$new_loser_points="20";
	}
		else	
{
$new_winner_points="215";
$new_loser_points="170";
  }
}

if ($level_diff == 9){
if ($winner[level] > $loser[level]){
	$new_winner_points="10";
	$new_loser_points="10";
	}
		else	
{
$new_winner_points="215";
$new_loser_points="170";
  }
}

if ($level_diff >= 10){
if ($winner[level] > $loser[level]){
	$new_winner_points="5";
	$new_loser_points="5";
	}
		else	
{
$new_winner_points="215";
$new_loser_points="170";
  }
}		
}
	else
			{

if ($level_diff == 0){
$new_winner_points="100";
$new_loser_points="100";
}

if ($level_diff == 1){

if ($winner[level] > $loser[level]){
	$new_winner_points="90";
	$new_loser_points="90";
	}
		else	
{
$new_winner_points="120";
$new_loser_points="110";
  }		
}

if ($level_diff == 2){
if ($winner[level] > $loser[level]){
	$new_winner_points="80";
	$new_loser_points="80";
	}
		else	
{
$new_winner_points="140";
$new_loser_points="120";
  }	
}

if ($level_diff == 3){
if ($winner[level] > $loser[level]){
	$new_winner_points="70";
	$new_loser_points="70";
	}
		else	
{
$new_winner_points="160";
$new_loser_points="130";
  }
}

if ($level_diff == 4){
if ($winner[level] > $loser[level]){
	$new_winner_points="60";
	$new_loser_points="60";
	}
		else	
{
$new_winner_points="175";
$new_loser_points="140";
  }
}

if ($level_diff == 5){
if ($winner[level] > $loser[level]){
	$new_winner_points="50";
	$new_loser_points="50";
	}
		else	
{
$new_winner_points="190";
$new_loser_points="150";
  }
}

if ($level_diff == 6){
if ($winner[level] > $loser[level]){
	$new_winner_points="40";
	$new_loser_points="40";
	}
		else	
{
$new_winner_points="205";
$new_loser_points="160";
  }
}

if ($level_diff == 7){
if ($winner[level] > $loser[level]){
	$new_winner_points="30";
	$new_loser_points="30";
	}
		else	
{
$new_winner_points="215";
$new_loser_points="170";
  }
}

if ($level_diff == {
if ($winner[level] > $loser[level]){
	$new_winner_points="20";
	$new_loser_points="20";
	}
		else	
{
$new_winner_points="215";
$new_loser_points="170";
  }
}

if ($level_diff == 9){
if ($winner[level] > $loser[level]){
	$new_winner_points="10";
	$new_loser_points="10";
	}
		else	
{
$new_winner_points="215";
$new_loser_points="170";
  }
}

if ($level_diff >= 10){
if ($winner[level] > $loser[level]){
	$new_winner_points="5";
	$new_loser_points="5";
	}
		else	
{
$new_winner_points="215";
$new_loser_points="170";
  }
};
}

//UPDATE WINNING TEAM

$new_winner_lrank="$winner[rank]";
$new_winner_wins=($winner[wins] + 1);
$new_winner_loss="$winner[loss]";
$new_winner_games=($winner[games] + 1);
$new_winner_percent=round($new_winner_wins / $new_winner_games * 100);
$new_winner_streak=($winner[streak] + 1);

if($new_winner_streak < 1){
$new_winner_streak="1";
}

//FIND WINNERS NEW RANK

$totalranked=mysql_query("SELECT COUNT(*) FROM ladder_$ladder[id] WHERE rank > '0'");
$totalranked=mysql_fetch_array($totalranked);
$totalranked="$totalranked[0]";

$adjustranks="";

if($winner[rank] > 0){
if(($winner[rank] > $loser[rank]) && ($loser[rank] > 0)){
$middlerank=(($winner[rank] + $loser[rank]) - 0.5);
$new_winner_rank=round(($middlerank / 2) - 0.5);
$adjustranks=1;
}else{
$new_winner_rank="$winner[rank]";
}
}
else{
$new_winner_rank=($totalranked + 1);
$adjustranks=1;
}

//UPDATE KILLS

if($ladder[isteam]){
while(list($teamid,$subarray)=each($login[member])){
  while(list($memberid,$kills)=each($subarray)){
   if($kills){
    if($teamid=="$login[wid]"){
    $updatepoints="points=points+$new_winner_points,";
    }else{
    $updatepoints="";
    }
$mem=mysql_query("SELECT * FROM members WHERE id='$memberid'");
    $mem=mysql_fetch_array($mem);

   mysql_query("UPDATE members SET $updatepoints kills=kills+$kills,joined='$mem[joined]',edited='$mem[edited]' WHERE id='$memberid'");
   $totalkills[$teamid]=($totalkills[$teamid] + $kills);
   }
  } 
}
}else{
while(list($teamid,$kills)=each($login[totalkills])){
$totalkills[$teamid]=($totalkills[$teamid] + $kills);
}
}

$new_loser_kills="$totalkills[$losid]";
$new_winner_kills="$totalkills[$winid]";


//UPDATE LOSING TEAM

if ($loser[level] == 1){
$multi=".13";
}

if ($loser[level] == 2){
$multi=".16";
}

if ($loser[level] == 3){
$multi=".16";
}

if ($loser[level] == 4){
$multi=".25";
}

if ($loser[level] == 5){
$multi=".25";
}

if ($loser[level] == 6){
$multi=".43";
}

if ($loser[level] == 7){
$multi=".43";
}

if ($loser[level] == {
$multi=".67";
}

if ($loser[level] == 9){
$multi=".67";
}

if ($loser[level] >= 10){
$multi="1";
  }

$loser_p=round($new_loser_points * $multi);

if ($loser[points] > 2500){
$Loser_p=($new_loser_points + $loser_p);
}
elseif ($loser[points] < $Loser_p && $loser[points] < $new_loser_points){
	$Loser_p="$loser[points]";
}else if($loser[points] <= 0){
	$Loser_p="0";
}
else{
  $Loser_p="$loser_p";
}

mysql_query("UPDATE ladder_$ladder[id] SET 
rank='$new_loser_rank',
lrank='$new_loser_lrank',
wins='$new_loser_wins',
loss='$new_loser_loss',
games='$new_loser_games',
percent='$new_loser_percent',
streak='$new_loser_streak',
points=points-'$Loser_p',
level=level,
kills=kills+'$new_loser_kills',
king=king,
lastmatch=NULL 
WHERE teamid ='$login[id]'");

//UPDATE WINNING TEAM

mysql_query("UPDATE ladder_$ladder[id] SET 
rank='$new_winner_rank',
lrank='$new_winner_lrank',
wins='$new_winner_wins',
loss='$new_winner_loss',
games='$new_winner_games',
percent='$new_winner_percent',
streak='$new_winner_streak',
points=points+'$new_winner_points',
level=level,
kills=kills+'$new_winner_kills',
king=king,
lastmatch=NULL 
WHERE teamid ='$login[wid]'");

// King Update/Change To New King

include("./report_inc_db.php");

//INSERT MATCH INTO DATABASE

mysql_query("INSERT INTO matchdb (ladderid, wid, lid, wname, lname, points, loser_new_points, wkills, lkills)
values('$ladder[id]','$winid','$losid','$winner[name]','$loser[name]','$new_winner_points','$Loser_p','$new_winner_kills','$new_loser_kills')");

//CLEAR CHALLENGE IF EXISTS

mysql_query("DELETE FROM challenges WHERE challgrid='$login[id]' && challgdid='$login[wid]' || challgrid='$login[wid]' && challgdid='$login[id]'");
mysql_query("DELETE FROM chall_chat WHERE challenger='$login[id]' && challenged='$login[wid]' || challenger='$login[wid]' && challenged='$login[id]'");

//ADJUST RANKS IF RANK WAS CHANGED

if($adjustranks){
include("./rankadjust.php");
$adjust[ladderid]="$ladder[id]";
$adjust[wid]="$login[wid]";
$adjust[newrank]="$new_winner_rank";
rank_adjust($adjust);
}


$out[body].="
<center>
<table width='90%' border='0' cellspacing='1' cellpadding='1' bgcolor='#00000'>
<tr bgcolor='$config[altcolora]'>
<td width='100%' valign='center' align='left' colspan='2' background='$config[bg]'>
<strong><font face='verdana' color='#272828'>Challenge</strong>";

$out[body].="
</td>
</tr>
<tr bgcolor='$config[altcolorb]'>
<td width='100%' valign='center' align='left'><font face='verdana' size='-2' color='#272828'>

<META HTTP-EQUIV='refresh' content='20;URL=$config[scripturl]/manager.php'> 
<br>
<center>
<b>
The match has been reported.
<br>
<br>
$winner[name] Defeated $loser[name]
<br>
<br>
<a href='$config[scripturl]/stats.php?account=$login[id]'>View Your Stats</a>
</b>
</center>
<br></td></tr>
</table>
<br>
</center>";

include("$config[html]");


}

?>


Link to comment
https://forums.phpfreaks.com/topic/63611-ladder-ranking-issue/
Share on other sites

I just realized that the level is also not going in right.

 

Also heres rankadjust.php

 

<?

function rank_adjust($adjust){

/*
$adjust[ladderid]
$adjust[wid]
$adjust[newrank]
*/

mysql_query("LOCK TABLES ladder_$adjust[ladderid]");

$ladderinfo=mysql_query("SELECT teamid,rank FROM ladder_$adjust[ladderid] WHERE teamid='$adjust[wid]'");
$linfo=mysql_fetch_array($ladderinfo);
$oldrank="$linfo[rank]";

if($linfo[teamid]){

if(($adjust[newrank] < $oldrank) && ($adjust[newrank] > 0) && ($oldrank > 0)){
mysql_query("UPDATE ladder_$adjust[ladderid] SET rank=rank+1 WHERE rank >= '$adjust[newrank]' AND rank <'$oldrank'");
}else{

if(($adjust[newrank]=="0") && ($oldrank > 0)){
mysql_query("UPDATE ladder_$adjust[ladderid] SET rank=rank-1 WHERE rank >= '$oldrank'");
}
if(($adjust[newrank] > 0) && ($oldrank=="0")){
mysql_query("UPDATE ladder_$adjust[ladderid] SET rank=rank+1 WHERE rank >= '$adjust[newrank]'");
}
if(($adjust[newrank] > 0) && ($oldrank > 0)){
mysql_query("UPDATE ladder_$adjust[ladderid] SET rank=rank-1 WHERE rank > '$oldrank' AND rank <='$adjust[newrank]'");
}

}

mysql_query("UPDATE ladder_$adjust[ladderid] SET rank='$adjust[newrank]' WHERE teamid='$adjust[wid]'");

}

mysql_query("UNLOCK TABLES");


$adjustranks="";
$counter=1;
$ladderinfo=mysql_query("SELECT rank FROM ladder_$adjust[ladderid] WHERE rank > '0' ORDER BY rank");
while(list($rank)=mysql_fetch_row($ladderinfo)){
if($rank!="$counter"){
$adjustranks=1;
}
$counter++;
}

if($adjustranks){
//mysql_query("LOCK TABLES ladder_$adjust[ladderid]");
$countranks=1;
$updateranks=mysql_query("SELECT teamid FROM ladder_$adjust[ladderid] WHERE rank > '0' ORDER by points");
while(list($team)=mysql_fetch_row($updateranks)){
mysql_query("UPDATE ladder_$adjust[ladderid] SET rank='$countranks' WHERE teamid='$team'");
$countranks++;
}
$ranksadjusted=1;
//mysql_query("UNLOCK TABLES");
}

return($ranksadjusted);
}


?>

Link to comment
https://forums.phpfreaks.com/topic/63611-ladder-ranking-issue/#findComment-316985
Share on other sites

I think this:

 

 $middlerank=(($winner[rank] + $loser[rank]) - 0.5);
$new_winner_rank=round(($middlerank / 2) - 0.5);

 

Should be using multiplicity rather than subtraction...

 

 $middlerank=(($winner[rank] + $loser[rank]) * 0.5);
$new_winner_rank=round(($middlerank / 2) * 0.5);

 

Also, I hope you are intentionally halfing again the "new winner rank" from the middle rank...making the new rank a quarter of the original value.

Link to comment
https://forums.phpfreaks.com/topic/63611-ladder-ranking-issue/#findComment-317164
Share on other sites

Its just a preset variable $team[xp], i really dont wanna change the code, just get the current one working.

 

From the website critique forum section you said you might be selling this script in the future, but it doesn't sound like you even made this script!

 

Anyway, your whole script is messed up. For middle rank you should get the average not some crazy addition and half subtraction!!!!  ::)

Link to comment
https://forums.phpfreaks.com/topic/63611-ladder-ranking-issue/#findComment-317205
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.