Results 1 to 11 of 11

Threaded View

  1. #1
    King-Orgy's Avatar
    Join Date
    Dec 2010
    Gender
    female
    Posts
    119
    Reputation
    15
    Thanks
    628
    My Mood
    Angelic

    Perfect Triggerbot

    Since we know after cod4 the crosshairclientnum from cg don't counts on higher distance we need to use something more tricky.

    Code:
    void (*CG_Trace)(Trace* Trace, vec3_t Start, vec3_t End, int skipNumber, int mask, int a6, int a7) = (void (__cdecl *)(Trace* , vec3_t , vec3_t , int , int , int , int ))0x00438A60;
    
    struct Trace
    {
         char              z_crap[16];
        float              fraction;
        char              z_crap2[8];
        WORD              solid;
        WORD                 allsolid;
        int               entityNum;
        int               unknow;
        char              z_crap3[68];
    };
    
    int  (__cdecl *k_AttackOn)() = (int (__cdecl *)())0x7FCF60;
    int  (__cdecl *k_AttackOff)() = (int (__cdecl *)())0x7FD030;
    
    Trace        crosshair_trace;
    
    int CAimbot::ScanCrosshairEntity( )
    {
        vec3_t angle, end;
     
        VectorCopy( cg->refdef.Location, angle);
        VectorMA( angle, 131072, cg->refdef.ViewAxis[0], end );
        
        CG_Trace( &crosshair_trace, angle, end, 0, 0x280B001, 0, 0 );  
    
        if(crosshair_trace.entityNum < 32 )
        {
            return crosshair_trace.entityNum;
        }
        return -1;
    }
    
    bool CAimbot::TriggerBot( )
    {
        int CrosshairClient = ScanCrosshairEntity( );
        
        static int lastShotTime = 0;  
        
        int GetTick = GetTickCount( );
        
        if(ClientInfo[CrosshairClient].Team != ClientInfo[ PlayerSnap->clientNum ].Team || ClientInfo[CrosshairClient].Team == TEAM_FREE)  
        {
            if ( !lastShotTime && CrosshairClient >=0 )
            {
                lastShotTime = GetTick;
                
                k_AttackOn( );
                
                return true;
            }
            else if(GetTick - lastShotTime > 100   )
            {
                lastShotTime = 0;
                
                k_AttackOff( );
                
                return false;
            }    
            else  if (lastShotTime != 0)
            {
                return true;
            }
        }
        return false;
    }
    credits goes to Tamimego and the quake sdk like always.

  2. The Following 5 Users Say Thank You to King-Orgy For This Useful Post:

    intervention61 (10-16-2011),monz (06-30-2011),PornFlakesreg (02-18-2011),Skyline. (01-25-2011),^...,^ (01-08-2011)