+ Reply to Thread
Results 1 to 1 of 1

  Click here to go to the first staff post in this thread.   Thread: TriggerBot

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Posts
    249
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Rep Power
    97

    TriggerBot

    Hi,

    Here is how to manage a trigger bot ( auto shoots if the crosshair is over an enemy ) using a processing command:
    PHP Code:
    m_pClient m_pGame->GetClient( );

    CWeaponClass *pLocalWeapon m_pLocalPlayer->GetSelectedWeapon( );

    ray_hit WeaponHitTest;

    if( 
    pLocalWeapon )
    {
        
    WeaponParams wp;
        
    m_pLocalPlayer->GetCurrentWeaponParamswp );

        
    m_fMaxWeaponDistance wp.fDistance;

        
    Vec3 LocalViewPosLocalViewAngle;

        if ( 
    m_pLocalPlayer->GetVehicle( ) )
        {
            
    LocalViewPos m_pLocalEntity->GetCamera( )->GetPos( );

            
    LocalViewAngle m_pLocalEntity->GetCamera( )->GetAngles( );
        }
        else
        {
            
    LocalViewAngle m_pLocalPlayer->m_vEyeAngles m_pLocalPlayer->m_vShake;

            
    LocalViewPos m_pLocalPlayer->m_vEyePos;
        }

        
    Vec3d Direction0, -1);
        
    Matrix44 LocalMatrix Matrix44::CreateRotationZYX( -LocalViewAngle*gf_DEGTORAD );
        
    Direction GetTransposed44LocalMatrix )*( Direction );

        
    Direction *= m_fMaxWeaponDistance;
        
        if( 
    m_pSystem->GetIPhysicalWorld( )->RayWorldIntersectionvectorfLocalViewPos ), vectorfDirection ), ent_allrwi_pierceability0, &WeaponHitTest1m_pLocalEntity->GetPhysics( ) ) )
        {
            if( 
    WeaponHitTest.pCollider )
            {
                
    IEntity *pEntTmp = ( IEntity * )WeaponHitTest.pCollider->GetForeignData( );

                
    CPlayer *pTmp 0;

                if( 
    pEntTmp && pEntTmp->IsTrackable( ) && pEntTmp->GetContainer( ) && pEntTmp->GetContainer( )->QueryContainerInterfaceCIT_IPLAYER, ( void ** )&pTmp ) && !m_pLocalPlayer->m_stats.firing )
                    
    m_pClient->m_PlayerProcessingCmd.AddActionACTION_FIRE0 );
                }
            }
        }

    You could use it IE in ProcessAngles before returning the original function

    Regards.
    Last edited by okidoki; 04-03-2009 at 03:43 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Triggerbot help
    By mencore in forum Beginner
    Replies: 8
    Last Post: 04-29-2008, 03:31 AM
  2. TriggerBot
    By P47R!CK in forum Source/HL2 Engine
    Replies: 24
    Last Post: 11-11-2007, 12:49 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts