Results 1 to 4 of 4
  1. #1
    jdslashv2's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    Bratislava
    Posts
    138
    Reputation
    10
    Thanks
    304
    My Mood
    Yeehaw

    Basic Aimbot Code for MP

    YOU CAN NOT C+P THIS INTO A HACK

    Aimbot.h
    Code:
    #pragma once
    
    class cAimbot_t
    {
    	public:
    		float distance( vec3_t origin );
    		bool  getVisibleBoneTag(centity_t *cent,vec3_t *origin);
    		int   AimAtFirstClient( );
    		void  AimTarget(int i);
    		void  Aimshoot( );
    	private:
    		#define VectorSub(a,b,c)	((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2])
    };
    
    
    extern cAimbot_t		AIMBOT;
    extern bool         isAutoAiming;
    extern vec3_t aimpoint;
    Aimbot.cpp
    Code:
    #include "stdafx.h"
    
    
    cAimbot_t		AIMBOT;
    
    float *ViewAngleX = (float *)0xF6B318;
    float *ViewAngleY = (float *)0xF6B314;
    
    
    float cAimbot_t::distance( vec3_t origin )
    {
    	vec3_t vector;
    	
    	VectorSub( origin, ref->vieworg, vector );
    	return ( sqrt( vector[0] * vector[0] + vector[1] * vector[1] + vector[2] * vector[2] ) );
    }
    
    char *HeadBodyTags[] = 	
    { 
    	"head",//1
    	"neck",//2	
    }; 
    
    vec3_t aimpoint;
    bool isAutoAiming=false;
    
    void cAimbot_t::Aimshoot()
    {
    	static int fire_state=0;
       	if(fire_state ) 
    	{
    		fire_state=0;
    		
    		CG_trap_SendConsoleCommand(1,1,"-attack\n" );
    	} 
    	
        else if(!fire_state && isAutoAiming ) 
    	{
    		fire_state=1;
    		
    		CG_trap_SendConsoleCommand(1,1,"+attack\n" );
    		
    	}
    }
    bool cAimbot_t::getVisibleBoneTag(centity_t *cent,vec3_t *origin) 
    {	
    		if (!MISC.GetTagForAimbot(cent,&aimpoint))
    		{		
    			return qfalse;
    		}
    		aimpoint[2] += 7.5;
    
    		vec3_t trDelta;
    		
    		float CG_PING=(PlayerSnap->ping)/50;
    		
    		VectorSubtract(cent->lerpOrigin_3, cent->lerpOrigin_2, trDelta);
    		
    		VectorMA(aimpoint,CG_PING,trDelta, aimpoint);
    
    		if (MISC.IsVisible( aimpoint))
    		{
    			return qtrue;
    		}
    	return qfalse;
    }
    int cAimbot_t::AimAtFirstClient()
    {
    	float leastDist=99999;
    	
    	int clientNum = -1;
    	
    	for( int i = 0; i < cgs->maxclients; i++ )
    	{	
    		if( (cg_entities[i].Alive && cg_entities[i].Valid  ) && (cg->clientNum != i))
    		{	
    			if(clientInfo[i].team != clientInfo[ cg->clientNum ].team || clientInfo[ i ].team == TEAM_FREE)  
    			{ 
    				if( getVisibleBoneTag(&cg_entities[i],&aimpoint) )
    				{ 
    					if(distance(aimpoint)<leastDist) 
    					{
    						leastDist = distance(aimpoint); 
    						clientNum=i;
    					}
    				}
    			}
    		}
    	}
    	if(clientNum!=-1)
    	{	        
    		return clientNum;		
    	}
    	return clientNum;
    }
    
    void cAimbot_t::AimTarget(int i)
    {
        if(i!=-1)
    	{ 	
    		float aX, aY;
    		
    		isAutoAiming = true;  
    
    		getVisibleBoneTag(&cg_entities[i],&aimpoint);
    		
    		MISC.VectorToViewangles(aimpoint, aX, aY);
    				
    		*ViewAngleX	+= aX;
    		*ViewAngleY	+= aY;
    		
    	}
    }
    Credits:
    KingOrgy
    Myself
    Many other people that I don't know!

  2. The Following User Says Thank You to jdslashv2 For This Useful Post:

    andresmo (04-17-2011)

  3. #2
    FukoChan's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Location
    NA
    Posts
    349
    Reputation
    62
    Thanks
    42
    My Mood
    Daring
    Spend some time discombobulating this. The Code is EVERYWHERE O.o
    [IMG]https://i1136.photobucke*****m/albums/n490/FumoChan/kco478.png[/IMG]


    Why look at sigs anyways?

    [IMG]https://i1136.photobucke*****m/albums/n490/FumoChan/AWESOME-1-1.jpg[/IMG]

  4. #3
    jdslashv2's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    Bratislava
    Posts
    138
    Reputation
    10
    Thanks
    304
    My Mood
    Yeehaw
    just like everyother code on this site

  5. #4
    lolbie's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Netherlands
    Posts
    5,207
    Reputation
    288
    Thanks
    2,136
    My Mood
    Angelic
    well thank you
    might come in handy
    I love it when people keep their agreements /sarcasm ftw