aimbot: is player visible for me ?

Posts 16 of 6 · Page 1 of 1
aimbot: is player visible for me ?
hello,
my cs go aimbot is currently aiming through walls. is there any simple check which i can use, for checking is the enemy player visible for me or not?

thanks..
Do a simple material trace.
can you please explain what u mean? currently i'm reading out the X Y Z coordinates and set the mouse on the enemy.
Quote Originally Posted by damnhack View Post
can you please explain what u mean? currently i'm reading out the X Y Z coordinates and set the mouse on the enemy.
The game has a function that does a trace from your position to the enemy. When certain flags are set, it checks if the bullet will collide with a wall, player, water etc.

Eg. Here's how to do a trace on MW3:

Code:
struct trace_t {
	float Fraction;
	Vector normal;
	int surfaceFlags;
	int contents;
	const char *material;
	int hitType;
	unsigned __int16 hitId;
	unsigned __int16 modelIndex;
	unsigned __int16 partName;
	unsigned __int16 partGroup;
	bool allsolid;
	bool startsolid;
	bool walkable;
};

bool IsVisible(Entity_T* currentEntity, float* vPoint) //vPoint is the position of the enemy you wish to aim at, Entity is the entity struct of the atim target
{
        trace_t trace; //Create a new trace
        CG_Trace( &trace, RefDef->ViewOrigin, currentEntity, CG->LocalClientNumber, 0x803003 ); //Engine does the trace here
        if( trace->Fraction >= 0.97f ) return true; //If fraction is >=0.97, enemy is visible
        else return false; //Else they're not
}
Quote Originally Posted by Kenshin13 View Post


The game has a function that does a trace from your position to the enemy. When certain flags are set, it checks if the bullet will collide with a wall, player, water etc.

Eg. Here's how to do a trace on MW3:

Code:
struct trace_t {
	float Fraction;
	Vector normal;
	int surfaceFlags;
	int contents;
	const char *material;
	int hitType;
	unsigned __int16 hitId;
	unsigned __int16 modelIndex;
	unsigned __int16 partName;
	unsigned __int16 partGroup;
	bool allsolid;
	bool startsolid;
	bool walkable;
};

bool IsVisible(Entity_T* currentEntity, float* vPoint) //vPoint is the position of the enemy you wish to aim at, Entity is the entity struct of the atim target
{
        trace_t trace; //Create a new trace
        CG_Trace( &trace, RefDef->ViewOrigin, currentEntity, CG->LocalClientNumber, 0x803003 ); //Engine does the trace here
        if( trace->Fraction >= 0.97f ) return true; //If fraction is >=0.97, enemy is visible
        else return false; //Else they're not
}
Well wont the code only work if he is aiming at the enemy? And that wouldn't work because he would aim back and forth constantly checking.. I'm assuming that's what you mean if not sorry.
Quote Originally Posted by mrcodehpr01 View Post
Well wont the code only work if he is aiming at the enemy? And that wouldn't work because he would aim back and forth constantly checking.. I'm assuming that's what you mean if not sorry.
Which is why you check for the best target. (Aka, one who is either closest to you or aiming at you more.)
Posts 16 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?