Internal Traceline
Greetings,
A few days ago I decided that spending too many hours on developing my External hack would be less good for me than trying to get into Internal development.
The reason is simply that External does not give me the speed ( example SpottedByMask ).
I am now attempting to do Traceline and I have searched around a bunch, and I've tried multiple different solutions that was given to others with similar issues like me, however all of them have resulted in instant game crash upon pressing the key I have assigned to start shooting the ray.
Hopefully there are some more experienced users here who can help me to get past this "wall"
Note: The reason why I am using "InCross" is so I can with certainty say that it's not a loop through all entities (players) that is causing the crash as I have already bugged InCross and it works perfectly fine.
Inside CreateMove
Trace Class
Best Regards,
Me
A few days ago I decided that spending too many hours on developing my External hack would be less good for me than trying to get into Internal development.
The reason is simply that External does not give me the speed ( example SpottedByMask ).
I am now attempting to do Traceline and I have searched around a bunch, and I've tried multiple different solutions that was given to others with similar issues like me, however all of them have resulted in instant game crash upon pressing the key I have assigned to start shooting the ray.
Hopefully there are some more experienced users here who can help me to get past this "wall"
Note: The reason why I am using "InCross" is so I can with certainty say that it's not a loop through all entities (players) that is causing the crash as I have already bugged InCross and it works perfectly fine.
Inside CreateMove
Code:
if (GetAsyncKeyState(0x05))
{
int cross = me->InCross();
if (cross > 0 && cross <= 64)
{
CBaseEntity* target = Interfaces.ClientEntList->GetClientEntity(cross);
if (target->isAlive() && target->GetTeamNum() != me->GetTeamNum())
{
Vector start, end;
start = me->GetEyePosition();
end = target->GetEyePosition();
trace_t Trace;
CTraceFilter Filter;
Ray_t Ray;
Ray.Init(start, end);
IEngineTrace* eTrace = new IEngineTrace();
eTrace->TraceRay(Ray, 0X4600400B, &Filter, &Trace);
}
}
}
Code:
#pragma once
#define Assert( _exp ) ((void)0)
class __declspec(align(16))VectorAligned : public Vector
{
public:
VectorAligned& operator=(const Vector &vOther)
{
Init(vOther.x, vOther.y, vOther.z);
w = 0.f;
return *this;
}
float w;
};
struct Ray_t
{
VectorAligned m_Start;
VectorAligned m_Delta;
VectorAligned m_StartOffset;
VectorAligned m_Extents;
bool m_IsRay;
bool m_IsSwept;
void Init(Vector& start, Vector& end)
{
m_Delta = start - end;
m_IsSwept = (m_Delta.LengthSqr() != 0);
m_Extents.x = m_Extents.y = m_Extents.z = 0.0f;
m_IsRay = true;
m_StartOffset.x = m_StartOffset.y = m_StartOffset.z = 0.0f;
m_Start = start;
}
};
struct cplane_t
{
Vector normal;
float dist;
BYTE type;
BYTE signbits;
BYTE pad[2];
};
struct csurface_t
{
const char* name;
short surfaceProps;
unsigned short flags;
};
enum TraceType_t
{
TRACE_EVERYTHING = 0,
TRACE_WORLD_ONLY, // NOTE: This does *not* test static props!!!
TRACE_ENTITIES_ONLY, // NOTE: This version will *not* test static props
TRACE_EVERYTHING_FILTER_PROPS, // NOTE: This version will pass the IHandleEntity for props through the filter, unlike all other filters
};
class ITraceFilter
{
public:
virtual bool ShouldHitEntity(void* pEntity, int mask) = 0;
virtual TraceType_t GetTraceType() const = 0;
};
class CTraceFilter : public ITraceFilter
{
public:
bool ShouldHitEntity(void* pEntityHandle, int contentsMask)
{
return !(pEntityHandle == pSkip1);
}
TraceType_t GetTraceType() const
{
return TRACE_EVERYTHING;
}
void* pSkip1;
};
class CBaseTrace
{
public:
bool func1();
bool func2();
bool func3();
bool func4();
bool func5();
public:
Vector startpos;
Vector endpos;
cplane_t plane;
float fraction;
int contents;
unsigned short dispFlags;
bool allsolid;
bool startsolid;
};
class CGameTrace : public CBaseTrace
{
public:
bool DidHitWorld();
bool DidHitNonWorldEntity();
int GetEntityIndex();
bool DidHit();
public:
float fractionleftsolid;
csurface_t surface;
int hitgroup;
short physicsbone;
unsigned short worldSurfaceIndex;
void *m_pEnt;
int hitbox;
};
typedef CGameTrace trace_t;
class IEngineTrace
{
public:
void TraceRay(const Ray_t &ray, unsigned int fMask, ITraceFilter* filter, trace_t *trace)
{
typedef void(__thiscall* fn)(void*, const Ray_t&, unsigned int, ITraceFilter*, trace_t*);
VMT.getvfunc<fn>(this, 5)(this, ray, fMask, filter, trace);
}
};
Me

