<commit_before><?php

    new hook("killMenu", function () {
        return array(
            "url" => "?page=bounties", 
            "text" => "Bounties", 
            "sort" => 150
        );
    });


    new hook("userKilled", function ($users) {
        $shooter = $users["shooter"];
        $killed = $users["killed"];

        $bounties = $shooter->db->prepare("
            SELECT SUM(B_cost) as 'reward' FROM bounties WHERE B_userToKill = :killed
        ");
        $bounties->bindParam(":killed", $killed->info->U_id);
        $bounties->execute();

        $bounty = $bounties->fetchAll(PDO::FETCH_ASSOC)["reward"];

        if ($bounty) {
            $update = $shooter->db->prepare("
                DELETE FROM bounties WHERE B_userToKill = :killed
            ");
            $update->bindParam(":killed", $killed->info->U_id);
            $update->execute();

            $shooter->newNotification(
                "You collected a bounty of $" . number_format($bounty) . " after shooting " . $killed->info->U_name
            );

            $shooter->set("US_money", $shooter->info->US_money + $bounty);

        }
<commit_msg>fixed error on killing a user<commit_after><?php

    new hook("killMenu", function () {
        return array(
            "url" => "?page=bounties", 
            "text" => "Bounties", 
            "sort" => 150
        );
    });


    new hook("userKilled", function ($users) {
        $shooter = $users["shooter"];
        $killed = $users["killed"];

        $bounties = $shooter->db->prepare("
            SELECT SUM(B_cost) as 'reward' FROM bounties WHERE B_userToKill = :killed
        ");
        $bounties->bindParam(":killed", $killed->info->U_id);
        $bounties->execute();

        $bounties = $bounties->fetchAll(PDO::FETCH_ASSOC);

        if (isset($bounties["reward"])) {
            $bounty = $bounties["reward"];
            $update = $shooter->db->prepare("
                DELETE FROM bounties WHERE B_userToKill = :killed
            ");
            $update->bindParam(":killed", $killed->info->U_id);
            $update->execute();

            $shooter->newNotification(
                "You collected a bounty of $" . number_format($bounty) . " after shooting " . $killed->info->U_name
            );

            $shooter->set("US_money", $shooter->info->US_money + $bounty);

        }

{'fraction_non_alphanumeric': 0.16751269035532995, 'fraction_numerical': 0.0025380710659898475, 'mean_word_length': 1.9823455233291298, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7650581', 'n_tokens_mistral': 801, 'n_tokens_neox': 729, 'n_words': 131}