short_name] = $row->fid;
}
$flags["--"] = 4;
// nastaveni aktivni BF3 DB
db_set_active('bf3db_soutez');
$resStats = db_query("SELECT SUM(tbl_server_stats.countplayers) AS PocetHracu, SUM(tbl_server_stats.SumScore) AS CelkoveSkore, SUM(tbl_server_stats.AvgScore) AS PrumerneSKORE, SUM(tbl_server_stats.SumKills) AS ZabitychHracu, SUM(tbl_server_stats.SumHeadshots) as PocetHeadShotu, SUM(tbl_server_stats.SumSuicide) as PocetSebevrazd, SUM(tbl_server_stats.SumRounds) as PocetOdehranychKol
FROM tbl_server_stats
WHERE tbl_server_stats.CountPlayers >0");
/*
$res = db_query("SELECT
tbl_playerdata.SoldierName as Nick,
SUM(tbl_playerstats.headshots) as headshoty
FROM tbl_playerstats,tbl_server_player,tbl_playerdata
WHERE tbl_playerstats.StatsID = tbl_server_player.StatsID and tbl_server_player.PlayerID = tbl_playerdata.PlayerID
GROUP BY Nick
ORDER BY headshoty DESC
LIMIT 100");
*/
/*
$res = db_query("SELECT
tbl_playerdata.SoldierName AS Nick,
tbl_weapons_melee.Repair_tool_kills AS killy_RepairToolem
FROM tbl_playerstats, tbl_server_player, tbl_playerdata, tbl_weapons_melee
WHERE tbl_playerstats.StatsID = tbl_server_player.StatsID
AND tbl_server_player.PlayerID = tbl_playerdata.PlayerID
AND tbl_playerstats.statsID = tbl_weapons_melee.statsid
GROUP BY SoldierName
ORDER BY killy_RepairToolem DESC
LIMIT 100");
*/
$res = db_query("SELECT
tbl_playerdata.SoldierName as Nick,
SUM(tbl_playerstats.Score) as PlayerScore,
SUM(Kills) as killy, SUM(Deaths) as smrti
FROM tbl_playerstats,tbl_server_player,tbl_playerdata
WHERE tbl_playerstats.StatsID = tbl_server_player.StatsID and tbl_server_player.PlayerID = tbl_playerdata.PlayerID
GROUP BY Nick
ORDER BY PlayerScore DESC
LIMIT 100");
// vraceni aktivni PZ DB
db_set_active('default');
$rowStats = db_fetch_object($resStats);
$i = 1;
while($row = db_fetch_object($res)) {
$uid = db_result(db_query("SELECT uid FROM {games_gameid} WHERE gid = %d AND LOWER(gameid) = LOWER('%s')", 1586, $row->Nick));
$trows[] = array(
array("data" => ($i++) . ".", "class" => "w_10p"),
($uid ? l($row->Nick, 'user/'.$uid) : check_plain($row->Nick)),
array("data" => number_format($row->PlayerScore, 0, ',', ' '), "class" => "w_15p"),
array("data" => number_format($row->smrti, 0, ',', ' '), "class" => "w_15p"),
);
}
print "
";
print "
Statistika serveru:
"; print "Počet hráčů | "; print "Celkové skóre | "; print "Průměrné skóre | "; print "Zabitých hráčů | "; print "Počet headshotů | "; print "Počet sebevražd | "; print "Počet odehraných kol | "; print "
---|---|---|---|---|---|---|
" . $rowStats->PocetHracu . " | "; print "" . $rowStats->CelkoveSkore . " | "; print "" . round($rowStats->PrumerneSKORE) . " | "; print "" . $rowStats->ZabitychHracu . " | "; print "" . $rowStats->PocetHeadShotu . " | "; print "" . $rowStats->PocetSebevrazd . " | "; print "" . $rowStats->PocetOdehranychKol . " | "; print "