• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

MyACC characters how to show kills

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

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);
            }
        }
    }
 
Wow this is hard work. -.-
If it doesn't use them then post the code you use to write it to page, instead of just saying none.
The code seems to work fine. So it could be how its written to the page.

As in post the section of your "characters.html.twig" where it shows frags.
 
Last edited:
Wow this is hard work. -.-
If it doesn't use them then post the code you use to write it to page, instead of just saying none.
The code seems to work fine. So it could be how its written to the page.
The issue is that its not used anywhere to show how many kills player have overall. Something that is related with kills is in lastkills.php and thats it
<?php/** * Last kills * * @package MyAAC * @author Gesior <jerzys - Pastebin.com (https://pastebin.com/7sBFaT09) so i dont know myself where to look
 
In twig is it called as frags_count and frags.. not $frag and $frags_count.
Thats why i said post your characters.twig as you saying its showing as 0 there. -.-
 
Your code has been deleted. but by the looks of it you only posted a small section.
Post both characters.php and characters.twig.html

You can send them on discord, if you don't want them public.
Lee#7225
 
Your code has been deleted. but by the looks of it you only posted a small section.
Post both characters.php and characters.twig.html

You can send them on discord, if you don't want them public.
Lee#7225
sent you message in private
 
Back
Top