Announcement

Collapse
No announcement yet.

"Perfect" Triggerbot + ProSpread

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • "Perfect" Triggerbot + ProSpread

    Fully compatible with Tkz 1.3.00 src.
    This triggerbot check nearest bone/hitbox in your radius (box) on screen.
    For ProSpread you need NoSpread code in your hack (we need just angles, not aplly NoSpread!!!).

    In CL_CreateMove
    Code:
    if(g_Local.weapon && !g_Local.bBadWpn(g_Local.iWeaponID) && g_Local.iClip > 0 && cvar.trigger->value > 0.0f && g_Local.bAlive)
    {
    for(int i = 1; i <= 32; i++)
    {
    if(i == g_Local.iIndex) continue;
    if(!g_Player[i].bUpdated) continue;
    if(!g_Player[i].bVisible) continue;
    if(cvar.trigger_dm->value == 0 && g_Player[i].iTeam == g_Local.iTeam) continue;
    
    float fScreenBone[2] = {}, fScreenHitbox[2] = {};
    if(g_Utils.bCalcScreen(cvar.trigger_onlyhead->value == 0 ?
    g_Player[i].vBone[g_Player[i].iNearestBoneID] : g_Player[i].vHitbox[11], fScreenBone)
    && g_Utils.bCalcScreen(cvar.trigger_onlyhead->value == 0 ?
    g_Player[i].vHitbox[g_Player[i].iNearestHitboxID] : g_Player[i].vHitbox[11], fScreenHitbox))
    {
    float fRad = ((POW(cvar.trigger_radius->value) * 10) / (g_Player[i].fDist * g_Local.iFOV));
    
    if(bInRad2(fScreenBone, fRad, i) || bInRad2(fScreenHitbox, fRad, i))
    {
    if(g_Local.m_flNextPrimaryAttack > 0.0 || g_Local.iInReload)
    cmd->buttons &= ~IN_ATTACK;
    else
    cmd->buttons |= IN_ATTACK;
    }
    }
    }
    }


    bInRad function
    Code:
    //bInRad - return true if crosshair in trigger radius, also calculation prospread.
    bool bInRad(float fScreen[2], float Fov, int iPlayerID)
    {
    if(cvar.trigger_prospread->value > 0.0f)
    {
    Vector spreadangles, forward, spread;
    pmtrace_t tr;
    
    VectorAdd(g_Local.cmdViewAngles, g_Local.vNoSpreadAng, spreadangles);
    
    g_Engine.pfnAngleVectors(spreadangles, forward, NULL, NULL);
    
    g_Engine.pEventAPI->EV_SetTraceHull(2);
    g_Engine.pEventAPI->EV_PlayerTrace(g_Local.vEye, g_Local.vEye + (forward * playerItems.CurDistance()), PM_GLASS_IGNORE, -1, &tr);
    
    g_Utils.bCalcScreen(tr.endpos, spread);
    
    spread.x = g_Screen.iWidth - spread.x;
    spread.y = g_Screen.iHeight - spread.y;
    
    float fScreenFinal[2] = {
    (float)(abs(spread.x - fScreen[0])),
    (float)(abs(spread.y - fScreen[1]))
    };
    
    return (fScreenFinal[0] <= Fov && fScreenFinal[1] <= Fov);
    }
    else
    {
    float ScreenOut[2] = {
    (float)(abs((g_Screen.iWidth / 2) - fScreen[0])),
    (float)(abs((g_Screen.iHeight / 2) - fScreen[1]))
    };
    
    return (ScreenOut[0] <= Fov && ScreenOut[1] <= Fov);
    }
    }

    Drawing current triggerbot bones/hitbox boxes.
    Code:
    //HUD_Redraw in players circle, if you want to see how triggerbot works.
    if(cvar.trigger_draw->value && g_Player[i].bUpdated && !g_Local.bBadWpn(g_Local.iWeaponID))
    {
    float fScreenBone[2] = {}, fScreenHitbox[2] = {};
    if(g_Utils.bCalcScreen(
    cvar.trigger_onlyhead->value == 0 ?
    g_Player[i].vBone[g_Player[i].iNearestBoneID] : g_Player[i].vBone[8], fScreenBone)
    && g_Utils.bCalcScreen(
    cvar.trigger_onlyhead->value == 0 ?
    g_Player[i].vHitbox[g_Player[i].iNearestHitboxID] : g_Player[i].vHitbox[11], fScreenHitbox))
    {
    float fRad = ((POW(cvar.trigger_radius->value) * 10) / (g_Player[i].fDist * g_Local.iFOV));
    
    g_Drawing.DrawBox(fScreenBone[0] - fRad, fScreenBone[1] - fRad, (fRad * 2), (fRad * 2), 2, 255, 0, 0, 255); // Red is bone
    g_Drawing.DrawBox(fScreenHitbox[0] - fRad, fScreenHitbox[1] - fRad, (fRad * 2), (fRad * 2), 2, 0, 0, 255, 255); // Blue is Hitbox
    }
    }
Working...
X