What's new

Welcome to HvH Forum!

SignUp Now! Download Free HvH CS2/CS:GO Cheats, CFG, LUA/JS Scripts, And More!


SignUp Now!

Source Code C_C4 entity bugged?

Newbie HvHer
User ID
162797
Messages
2
Reactions
0
Level
4
Hello i have this fragment of code:
Code:
void f::get_player_info()
{
    m_data["m_players"] = nlohmann::json::array();

    const auto highest_idx = i::m_game_entity_system->m_highest_entity_idx();
    for (int32_t idx = 0; idx < highest_idx; idx++)
    {
        const auto entity = i::m_game_entity_system->get(idx);
        if (!entity)
            continue;

        const auto entity_handle = entity->get_ref_e_handle();
        if (!entity_handle.is_valid())
            continue;

        const auto class_name = entity->get_schema_class_name();


        if (class_name.empty())
            continue;

        const auto hashed_class_name = fnv1a::hash(class_name);

        if (hashed_class_name == fnv1a::hash("CCSPlayerController"))
        {
            const auto player = i::m_game_entity_system->get<c_cs_player_controller*>(entity_handle);
            if (!player)
                continue;

            const auto player_pawn = player->get_player_pawn();
            if (!player_pawn)
                continue;

            if (!f::players::get_data(idx, player, player_pawn))
                continue;

            f::players::get_weapons(player_pawn);
            f::players::get_active_weapon(player_pawn);

            m_data["m_players"].push_back(m_player_data);
        }
        else if (hashed_class_name == fnv1a::hash("C_C4"))
        {
            const auto bomb = entity;
            f::bomb::get_carried_bomb(bomb);
        }
        else if (hashed_class_name == fnv1a::hash("C_PlantedC4"))
        {
            const auto planted_c4 = reinterpret_cast<c_planted_c4*>(entity);
            f::bomb::get_planted_bomb(planted_c4);
        }
    }
}

For get the C4 carried and get c4 planted entity. Sometimes works and others no.... Any can helpme here?

pd: i debugged the classnames comming from memory but sometimes appear C_C4 and sometimes not..
 
Paster
Creator
User ID
22986
Messages
220
Reactions
299
Level
36
Hello i have this fragment of code:
Code:
void f::get_player_info()
{
    m_data["m_players"] = nlohmann::json::array();

    const auto highest_idx = i::m_game_entity_system->m_highest_entity_idx();
    for (int32_t idx = 0; idx < highest_idx; idx++)
    {
        const auto entity = i::m_game_entity_system->get(idx);
        if (!entity)
            continue;

        const auto entity_handle = entity->get_ref_e_handle();
        if (!entity_handle.is_valid())
            continue;

        const auto class_name = entity->get_schema_class_name();


        if (class_name.empty())
            continue;

        const auto hashed_class_name = fnv1a::hash(class_name);

        if (hashed_class_name == fnv1a::hash("CCSPlayerController"))
        {
            const auto player = i::m_game_entity_system->get<c_cs_player_controller*>(entity_handle);
            if (!player)
                continue;

            const auto player_pawn = player->get_player_pawn();
            if (!player_pawn)
                continue;

            if (!f::players::get_data(idx, player, player_pawn))
                continue;

            f::players::get_weapons(player_pawn);
            f::players::get_active_weapon(player_pawn);

            m_data["m_players"].push_back(m_player_data);
        }
        else if (hashed_class_name == fnv1a::hash("C_C4"))
        {
            const auto bomb = entity;
            f::bomb::get_carried_bomb(bomb);
        }
        else if (hashed_class_name == fnv1a::hash("C_PlantedC4"))
        {
            const auto planted_c4 = reinterpret_cast<c_planted_c4*>(entity);
            f::bomb::get_planted_bomb(planted_c4);
        }
    }
}

For get the C4 carried and get c4 planted entity. Sometimes works and others no.... Any can helpme here?

pd: i debugged the classnames comming from memory but sometimes appear C_C4 and sometimes not..
highest entity index doesn't work since the latest update
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Top