SixNine
Active Member
- Joined
- Dec 12, 2018
- Messages
- 452
- Reaction score
- 41
Hi i have custom character page and for some reason it doesnt show kills it always stays at zero
i think its these code parts
i think its these code parts
PHP:
'.$twig->render('characters.html.twig', array(
'outfit' => isset($outfit) ? $outfit : null,
'player' => $player,
'account' => $account,
'flag' => $flag,
'frags_enabled' => $frags_enabled,
'frags_count' => $frags_count,
'skills' => isset($skills) ? $skills : null,
'skull' => $player->getSkullTime() > 0 && ($player->getSkull() == 4 || $player->getSkull() == 5) ? $skulls[$player->getSkull()] : null,
'deaths' => $deaths,
'frags' => $frags,
'player_link' => getPlayerLink($player->getName(), false),
'hidden' => $hidden,
'bannedUntil' => isset($bannedUntil) ? $bannedUntil : null,
'characters_link' => getLink('characters'),
'account_players' => isset($account_players) ? $account_players : null,
'achievements' => $playerAchievements,
'search_form' => generate_search_form()
)).'
PHP:
$frags_enabled = tableExist('player_killers') && $config['characters']['frags'];
$frags_count = 0;
if($frags_enabled) {
$query = $db->query(
'SELECT COUNT(`player_id`) as `frags`' .
'FROM `player_killers`' .
'WHERE `player_id` = ' .$player->getId() . ' ' .
'GROUP BY `player_id`' .
'ORDER BY COUNT(`player_id`) DESC');
if($query->rowCount() > 0)
{
$query = $query->fetch();
$frags_count = $query['frags'];
}
}
PHP:
$frags = array();
$frag_add_content = '';
if($config['characters']['frags'])
{
//frags list by Xampy
$i = 0;
$frags_limit = 10; // frags limit to show? // default: 10
$player_frags = $db->query('SELECT `player_deaths`.*, `players`.`name`, `killers`.`unjustified` FROM `player_deaths` LEFT JOIN `killers` ON `killers`.`death_id` = `player_deaths`.`id` LEFT JOIN `player_killers` ON `player_killers`.`kill_id` = `killers`.`id` LEFT JOIN `players` ON `players`.`id` = `player_deaths`.`player_id` WHERE `player_killers`.`player_id` = '.$player->getId().' ORDER BY `date` DESC LIMIT 0,'.$frags_limit.';')->fetchAll();
if(count($player_frags))
{
$row_count = 0;
foreach($player_frags as $frag)
{
$description = 'Fragged <a href="' . getPlayerLink($frag['name'], false) . '">' . $frag['name'] . '</a> at level ' . $frag['level'];
$frags[] = array('time' => $frag['date'], 'description' => $description, 'unjustified' => $frag['unjustified'] != 0);
}
}
}