ROWAREZ
rowarez hacking forum
Lista Forumurilor Pe Tematici
ROWAREZ | Reguli | Inregistrare | Login

POZE ROWAREZ

Nu sunteti logat.
Nou pe simpatie:
ice_babby la Simpatie.ro
Femeie
19 ani
Constanta
cauta Barbat
26 - 57 ani
ROWAREZ / Games Hacks / Knife Bot (CounterStrike Source)  
Autor
Mesaj Pagini: 1
Google
Resident Elite

Inregistrat: acum 12 ani
Postari: 433


Code:

// Stab is secondary attack, set it to FALSE for primary attack
BOOL CMisc::LandedSwingOnPlayer( BOOL& FromBehind, BOOL Stab )
{
    if ( gLocalWeapon->GetWeaponID( ) != WEAPON_KNIFE )
        return FALSE;

    if ( gLocalWeapon->ReadyToAttack( ) == FALSE )
        return FALSE;

    Vector Forward;
    AngleVectors( gUserCmd->viewangles, Forward );

    Vector ForwardBackup( Forward );

    if ( Stab == TRUE )
        Forward *= 32;
    else
        Forward *= 48;

    Vector Start = gLocalEntity->EyePosition( );
    Vector End = Start + Forward;

    trace_t tr;

    UTIL_TraceLine( Start, End, &tr );

    CONST Vector HeadMins( -16, -16, -18 );
    CONST Vector HeadMaxs( 16, 16, 18 );

    if ( tr.Fraction == 1.0 )
        UTIL_TraceHull( Start, End, HeadMins, HeadMaxs, &tr );

    if ( tr.Fraction < 1.0 )
    {
        IClientEntity* pEntityTouched = tr.pPlayerHit;

        if ( gPlayerManager.ValidPlayer( pEntityTouched ) == FALSE )
            return FALSE;

        if ( gPlayerManager.Enemy( pEntityTouched ) == FALSE )
            return FALSE;

        AngleVectors( pEntityTouched->GetRenderAngles( ), Forward );

        Vector2D MyLOS( ForwardBackup.x, ForwardBackup.y );
        D3DXVec2Normalize( &MyLOS, &MyLOS );

        Vector2D TargetLOS( Forward.x, Forward.y );
        D3DXVec2Normalize( &TargetLOS, &TargetLOS );

        FLOAT DotProduct = D3DXVec2Dot( &MyLOS, &TargetLOS );

        if ( DotProduct > 0.80f )
            FromBehind = TRUE;

        return TRUE;
    }

    return FALSE;
}

Credits: SourceSDK


pus acum 12 ani
   
Pagini: 1  

Mergi la