What's new

Welcome to HvH Forum!

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


SignUp Now!
Newbie HvHer
User ID
21982
Messages
1
Reactions
0
Level
1
Hi guys, i have a problem with my SimulateFireBullet function, for some reason that i dont know, the function dont pass this part making my damage always getting 0, i dont know why, i already searched in all internet, other sources, i already tried to remake these function and nothing, always returns here, someone know why?

SimulateFireBullet Problem Lines:
Code:
trace_line(data.src, end, MASK_SHOT_HULL | CONTENTS_HITBOX, &filter, &data.enter_trace);
        ClipTraceToPlayers(player, data.src, end + data.direction * 40.f, MASK_SHOT_HULL, &data.filter, &data.enter_trace);

        g_CVar->ConsolePrintf("SFB 4\n");
        if (data.enter_trace.fraction == 1.0f)
        {
            if (player && !(player->m_fFlags() & FL_ONGROUND))
            {
                data.enter_trace.hitgroup = GetHitgroup(hitbox);
                data.enter_trace.hit_entity = player;
            }
            else
                break; 
        }

trace_line function:
Code:
void trace_line(Vector& start, Vector& end, unsigned int mask, CTraceFilter* filter, CGameTrace* tr)
{
    Ray_t ray;
    ray.Init(start, end);

    g_EngineTrace->TraceRay(ray, mask, filter, tr);
}

ClipTraceToPlayers Function:
Code:
trace_t playerTrace;
    Ray_t ray;
    float smallestFraction = tr->fraction;
    const float maxRange = 60.0f;

    ray.Init(start, end);

    if (!player || !player->IsAlive() || player->IsDormant())
        return;

    if (filter && filter->ShouldHitEntity(player, mask) == false)
        return;

    float range = DistanceToRay(player->WorldSpaceCenter(), start, end);
    if (range < 0.0f || range > maxRange)
        return;

    g_EngineTrace->ClipRayToEntity(ray, mask | CONTENTS_HITBOX, player, tr);

i dont know what can i do more to made this function works!
 

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