PDA

View Full Version : basic knifebot



STR
01-11-07, 06:13
Basic


first we need a function to find the distance between ourselves and the target ent

float cEntity::flGetDistance( int index )
{
IClientEntity* pEntity = main.m_pEntList->GetClientEntity( index );
if (pEntity == NULL )
return 999999.0f;
return flGetDistance( pEntity->GetAbsOrigin() );
}

float cEntity::flGetDistance( Vector vPlayer )
{
IClientEntity* pEntity = main.m_pEntList->GetClientEntity( main.m_pEngine->GetLocalPlayer() );
if ( pEntity == NULL )
return 999999.0f;
Vector vDeltaOrigin = vPlayer - pEntity->GetAbsOrigin();
return sqrtf( vDeltaOrigin.Length() );
}

now we need to set when to stab


bool cCAimbot::CanStab()
{
flBestDist = main.m_pEntity->flGetDistance( vPlayer );

if(cvars.knifebot_stab_distance > flBestDist)//or u can perfect this manualy
return true;

return false;
}

then in your aiming function:

if(cvars.knifebot == 1 && gWeapon.IsCurWepKnife() && CanStab())
cmd->buttons = IN_ATTACK2;

credits: hlh(distance func)

Zєяo
01-11-07, 06:18
can you post the final version too? so i can use it?

STR
01-11-07, 06:26
LOL

Zєяo
02-11-07, 10:06
Just a question ;)

anal.
30-11-07, 07:53
great work, fuminster

zeziman
30-11-07, 02:53
say wat emba

m4nusp
30-11-07, 03:40
I might be a newbie, quite newbish.. When it comes to CS:S Hacking and coding.
Anyhow Could anyone answer me when i ask "What is a knifebot?"

Don't gte fucking lippy with him u cant even code

zeziman
01-12-07, 03:47
Nice, this 'll come usefull for me, as i am Starting to learn Coding through C++ :D
Thank you.

Pts
25-08-08, 07:10
Where would I put the CanStab()); identifier?
without it my knifebot switches glock from burst to single, usp to silence, etc.



Client.cpp(153) : error C3861: 'CanStab': identifier not found, even with argument-dependent lookup

Lawgiver
25-08-08, 07:17
You can put it in your aimbot class ( Or in any other class tbh ) or just doing a normal function ( Has to be defined before the call happens... )

Pts
25-08-08, 07:32
Gotten the code to compile, going to see if its fixed.
Thanks again Lawgiver

Edit: Alright, its still doing the same thing.
wtf.

Suddenvegatable
31-08-08, 02:13
Does this code stuff work irl?

E.G I'm down a ally way black people pop out ask for my wallet. And then I use my knifebot and shank them all with ease.

Epic. Love if some retarded posted tht. Aka me.

This is a complete and utter retard spam post.

Moral of the storey. GJ Josh :)

zhxinsanity
10-07-09, 08:07
knifebot!!!!

kingdeking
27-08-09, 09:43
wont this knife attack every entity that will be in a certain range as you are not checking if the entity is a player. This could be easily done by checking if player is alive :/ or am i wrong?

indestructable
27-08-09, 11:37
wont this knife attack every entity that will be in a certain range as you are not checking if the entity is a player. This could be easily done by checking if player is alive :/ or am i wrong?

ur wrong, sir