PDA

View Full Version : Anti-Aim Spinbot



STR
27-08-07, 05:12
void cCAimbot::AntiAim(CUserCmd* cmd)
{
int *iFlAgs = (int*) ( (DWORD)HalFLife2.m_pMyPlayer->BaseEnt() + (DWORD)0x2B4 );
int iFlags = *iFlAgs;
if( cmd->buttons & IN_ATTACK)
return;

Vector viewforward, viewright, viewup, aimforward, aimright, aimup;
QAngle qAimAngles;
float forward = cmd->forwardmove;
float right = cmd->sidemove;
float up = cmd->upmove;
qAimAngles.Init(0.0f, cmd->viewangles.y, 0.0f);
AngleVectors(qAimAngles, &viewforward, &viewright, &viewup);
AngleVectors(cmd->viewangles, &viewforward, &viewright, &viewup);
float fTime = HalFLife2.m_pEngine->Time();

cmd->viewangles.y -= 75.0f;
cmd->viewangles.x -= 180.0f;
cmd->viewangles.z = fmod(-360.0f, 360.0f);

qAimAngles.Init(0.0f, cmd->viewangles.y, 0.0f);
AngleVectors(qAimAngles, &aimforward, &aimright, &aimup);
AngleVectors(cmd->viewangles, &aimforward, &aimright, &aimup);
Vector vForwardNorm; Normalize ( viewforward, vForwardNorm );
Vector vRightNorm; Normalize( viewright, vRightNorm );
Vector vUpNorm; Normalize( viewup, vUpNorm );
cmd->forwardmove = DotProduct(forward * vForwardNorm, aimforward) + DotProduct(right * vRightNorm, aimforward) + DotProduct(up * vUpNorm, aimforward);
cmd->sidemove = DotProduct(forward * vForwardNorm, aimright) + DotProduct(right * vRightNorm, aimright) + DotProduct(up * vUpNorm, aimright);
cmd->upmove = DotProduct(forward * vForwardNorm, aimup) + DotProduct(right * vRightNorm, aimup) + DotProduct(up * vUpNorm, aimup);

}

credits: tetsuo & v3n0m4

Cheen
04-09-07, 11:16
where do i put that for it to work?

In a source code ;)

Reneg4d3
06-09-07, 12:26
If you don't know how to use it, I suggest you just use a premade hack. Such as.. Oh i don't know... maybe P7? Hint: This is the PROGRAMMING SECTION, there is no "HACK" in here :D

v3n0m4
12-09-07, 09:27
hehe some ppl are just not usefull like my post.

:eek:

Megamorph
19-10-07, 02:57
Hey all,

big thx Fum1n for your nice AntiAim source code example.

I just got one problem:
I can't find a function Normalize() which can take two arguments.
Maybe i use too old SDK?
So i downloaded new version and searched for "Normalize" in alle the Files with the search function, but there are too many hits to look up each and look for the declaration of the function.

Maybe you can point me to the right file, to the function or give another tip.
Big thx!

Megamorph

STR
19-10-07, 05:04
void cEntity::Normalize(Vector &vIn, Vector &vOut)
{
float flLen = vIn.Length();
if(flLen == 0)
{
vOut.Init(0, 0, 1);
return;
}
flLen = 1 / flLen;
vOut.Init(vIn.x * flLen, vIn.y * flLen, vIn.z * flLen);
}

Megamorph
19-10-07, 11:21
I really want to thank you, it works fine now. :)

I just integrated AntiAim in this way in the main loop of the hack:


//aim bot call (with nospread, antirecoil, autoshoot included)
HalFLife2.m_pAimbot->AntiAim( cmd );
//misc call (bunny hop, auto duck, ...)

It works in this way and the aim is still very fast. :)

Maybe you have other ideas or tips i can try.
Megamorph

aVitamin
22-10-07, 12:19
i think you dont want to spin if you are holding a knife or a nade...
so....


C_BaseCombatWeapon* m_pWeapon = m_pUtils->GetBaseCombatActiveWeapon ( m_pMyBaseEnt() );

if ( !m_pWeapon )
return ;

const char *myWeap = m_pModelinfo->GetModelName ( m_pWeapon->GetModel());

if( strstr( myWeap, "_knife_t.mdl" )
|| strstr( myWeap, "_knife_ct.mdl" )
|| strstr( myWeap, "_eq_flashbang.mdl" )
|| strstr( myWeap, "_eq_fraggrenade.mdl" )
|| strstr( myWeap, "_eq_smokegrenade.mdl" )
|| strstr( myWeap, "_c4.mdl" ))
return;

STR
22-10-07, 05:54
The full weapon name isn't needed, you can just strstr 'eq'. :)




bool cWeaponTools::IsCurWepKnifeOrNade()
{
C_BaseCombatWeapon* m_pCurWeapon = base.m_pUtil->GetBaseCombatActiveWeapon ( base.m_pMyPlayer->BaseEnt() );
if (m_pCurWeapon)
{
if ( strstr(base.m_pModelinfo->GetModelName ( m_pCurWeapon->GetModel()), "eq") || strstr(base.m_pModelinfo->GetModelName ( m_pCurWeapon->GetModel()), "knife"))
return true;
}
return false;
}

aVitamin
23-10-07, 04:29
yep sure but i prefer to code neat