Ejemplo n.º 1
0
function getPlayerSummary($player, $weapons, $vehicles, $kits, $armies, $maps)
{
    # mensch mach was!
    $summary['weapon'] = 0;
    $summary['vehicle'] = 0;
    $summary['kit'] = 0;
    $summary['army'] = 0;
    $summary['map'] = 0;
    $max = -1;
    #0..12 ()
    for ($i = 0; $i <= 10; $i++) {
        if ($weapons[$i]['time'] > $max) {
            $summary['weapon'] = $i;
            $max = $weapons[$i]['time'];
        }
    }
    if ($weapons[11]['time'] + $weapons[13]['time'] + $weapons[14]['time'] > $max) {
        $summary['weapon'] = 11;
        $max = $weapons[11]['time'] + $weapons[13]['time'] + $weapons[14]['time'];
    }
    if ($weapons[12]['time'] > $max) {
        $summary['weapon'] = 12;
    }
    $max = -1;
    for ($i = 0; $i <= getKitCount() - 1; $i++) {
        if ($kits[0]['time' . $i] > $max) {
            $summary['kit'] = $i;
            $max = $kits[0]['time' . $i];
        }
    }
    $max = -1;
    for ($i = 0; $i <= getVehicleCount() - 1; $i++) {
        if ($vehicles[0]['time' . $i] > $max) {
            $summary['vehicle'] = $i;
            $max = $vehicles[0]['time' . $i];
        }
    }
    $max = -1;
    for ($i = 0; $i <= getArmyCount(); $i++) {
        if ($armies[0]['time' . $i] > $max) {
            $summary['army'] = $i;
            $max = $armies[0]['time' . $i];
        }
    }
    return $summary;
}
Ejemplo n.º 2
0
			<td nowrap="nowrap" title="' . getExpasionTimeByName($PID, 'sf') . '">' . intToTime(getExpasionTimeByName($PID, 'sf')) . '</td>

			<td nowrap="nowrap" title="' . getExpasionTimeByName($PID, 'ef') . '">' . intToTime(getExpasionTimeByName($PID, 'ef')) . '</td>
			<td nowrap="nowrap" title="' . getExpasionTimeByName($PID, 'af') . '">' . intToTime(getExpasionTimeByName($PID, 'af')) . '</td>
		</tr>
	</table>
	<table border="0" cellspacing="0" cellpadding="0" id="kit" class="stat sortable">
		<tr>
			<th>Kit</th>

			<th>Time</th>
			<th>Kills</th>
			<th>Deaths</th>
			<th>Ratio</th>
		</tr>';
for ($i = 0; $i <= getKitCount() - 1; $i++) {
    # <tr class="favorite"> first line!
    $template .= '
		<tr>
			<td id="kit-' . $i . '">' . getKitByID($i) . '</td>

			<td nowrap="nowrap" title="' . $kits[0]['time' . $i] . '">' . intToTime($kits[0]['time' . $i]) . '</td>
			<td><span class="abbr" alt="Accounts for ';
    if ($player['kills']) {
        $template .= round(100 * $kits[0]['kills' . $i] / $player['kills'], 2);
    } else {
        $template .= 0;
    }
    $template .= '% of all kills">' . $kits[0]['kills' . $i] . '</span></td>
			<td>' . $kits[0]['deaths' . $i] . '</td>
			<td>';