I tried to create an Autoshoot ipmroove. The result was the following:
bool GetHit( Vector& vecAbsStart, Vector& vecAbsEnd, C_BaseEntity* pBaseEnt )
{
player_info_t pinfo;
trace_t tr;
Ray_t ray;
ray.Init( vecAbsStart, vecAbsEnd );
HalFLife2.m_pEnginetrace->TraceRay( ray, MASK_NPCWORLDSTATIC|CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTER|CONTENTS_WINDOW|CONTENTS_DEBRIS|CONTENTS_HITBOX, NULL, &tr );
if(tr.fraction == 1.0)
return false;
if(tr.hitbox == 0)
return false;
if(tr.hitgroup == 0)
return false;
surfacedata_t *pSurfaceData = HalFLife2.m_pPhysicAPI->GetSurfaceData( tr.surface.surfaceProps );
int iMaterial = pSurfaceData->game.material;
switch ( iMaterial )
{
case CHAR_TEX_BLOODYFLESH:
return true;
case CHAR_TEX_FLESH:
return true;
default :
return false;
}
return false;
}
at bottom of aimbot.cpp
link bwillhit to cl_createmove
bool bWillHit (float* fSpreadangles,float* fPunchangles,float * fAimAngles)
{
// note: the third ArrayElement of fPunchangles & fSpreadangles is Fixed
// if you can't fix them, ignore them :)
pmtrace_t *vis;
float fTraceVec[3],Origin[3];
fTraceVec[0] = fSpreadangles[0] + fPunchangles[0] + fAimAngles[0];
fTraceVec[1] = fSpreadangles[1] + fPunchangles[1] + fAimAngles[1];
fTraceVec[2] = fSpreadangles[2] + fPunchangles[2] + fAimAngles[2];
AngletoVector(fTraceVec,Origin);
vis = gEngfuncs.PM_TraceLine( me.pmEyePos, Origin, PM_TRACELINE_PHYSENTSONLY, 2, -1 );
return (vis->inopen == false);
}
// Returns true if hEnt points at the world entity.
// If this returns true, then you can't use GetHitBoxIndex().
bool DidHitWorld() const;
// Returns true if we hit something and it wasn't the world.
bool DidHitNonWorldEntity() const;
// Gets the entity's network index if the trace has hit an entity.
// If not, returns -1.
int GetEntityIndex() const;
// Returns true if there was any kind of impact at all
bool DidHit() const;
It will be finde if there is a Check which lookup if I hit Hitbox 14 with my applied Spread and Punch Angle :)
Comment