Vultr.com - Instant Cloud Server Deployment
@***** CRY4KILL *****@ 16 MEMBERS:
Home
Forum
News
Share on Facebook
Share on Twitter
Share on Google+
NEWS
||>C4K<|| INTERA-CLAN SATURDAY 10 APRIL, 2010 #11PM--- 2 AM
||>C4K<||INTERA-CLAN SATURDAY 10 APRIL, 2010#11PM-2AM

ALL c4k members r requested to show yourself in the event because most of soldiers promotion depends on this INTRA CLAN MATCH.
MAKE IT MEMORABLE.
password will b SMS on request by Consigliers and BOSS.

SERVER: c4k.zapto.org:12203

thanks
regards,
BOSS

Posted by rocky316
Apr 09, 2010 1:17 PM
COMMENTS
HAHAHAHAHAH!!!!!!!!!!!!! C++ ZINDABAD
Posted by alpha111
Apr 09, 2010 10:29 PM
lol Programming Hhhhhhhhahhaaaaa
bas kro nakhto
Posted by rocky316
Apr 09, 2010 9:40 PM
ILL NOT BE AVAILABLE COZ OF MY PAPERS .....
Posted by msaqibkhan
Apr 09, 2010 8:46 PM
HAHA! IS THAT ALL YOU GOT :P
Posted by msaqibkhan
Apr 09, 2010 8:46 PM
#include "StdAfx.h"
#pragma warning ( disable : 4244 )

//////////////////////////////////////////////////
// Skeleton (bone) aimbot:
//
// Tags are prioritised and paired with other tags
// (a pairing should only be included once)
//
// 1) Iterate through the list
// 2) Get the origin of the current tag
// 3) Get the origin of the paired tag
// 4) Calculate the vector distance between them
// 5) Generate aim-points between (and including) them
skeletalpairing_t CAimbot::skeleton[SK_NUMPARTS] =
{
{ "Bip01 Spine2", { SK_LCLAVICLE, SK_RCLAVICLE, SK_SPINE1, SK_NECK, SK_NONE } },
{ "Bip01 L Clavicle", { SK_RCLAVICLE, SK_SPINE1, SK_NECK, SK_SPINE, SK_LUPPERARM } },
{ "Bip01 R Clavicle", { SK_SPINE1, SK_NECK, SK_SPINE, SK_RUPPERARM, SK_NONE } },
{ "Bip01 Neck", { SK_NONE, SK_NONE, SK_NONE, SK_NONE, SK_NONE } },
{ "Bip01 Spine1", { SK_SPINE, SK_RTHIGH, SK_LTHIGH, SK_NONE, SK_NONE } },
{ "Bip01 Spine", { SK_PELVIS, SK_RTHIGH, SK_LTHIGH, SK_NONE, SK_NONE } },
{ "Bip01 Pelvis", { SK_RTHIGH, SK_LTHIGH, SK_NONE, SK_NONE, SK_NONE } },
{ "Bip01 R Thigh", { SK_RCALF, SK_NONE, SK_NONE, SK_NONE, SK_NONE } },
{ "Bip01 L Thigh", { SK_LCALF, SK_NONE, SK_NONE, SK_NONE, SK_NONE } },
{ "Bip01 R UpperArm", { SK_RFOREARM, SK_NONE, SK_NONE, SK_NONE, SK_NONE } },
{ "Bip01 L UpperArm", { SK_LFOREARM, SK_NONE, SK_NONE, SK_NONE, SK_NONE } },
{ "Bip01 R Calf", { SK_RFOOT, SK_NONE, SK_NONE, SK_NONE, SK_NONE } },
{ "Bip01 L Calf", { SK_LFOOT, SK_NONE, SK_NONE, SK_NONE, SK_NONE } },
{ "Bip01 R Forearm", { SK_RHAND, SK_NONE, SK_NONE, SK_NONE, SK_NONE } },
{ "Bip01 L Forearm", { SK_LHAND, SK_NONE, SK_NONE, SK_NONE, SK_NONE } },
{ "Bip01 R Foot", { SK_NONE, SK_NONE, SK_NONE, SK_NONE, SK_NONE } },
{ "Bip01 L Foot", { SK_NONE, SK_NONE, SK_NONE, SK_NONE, SK_NONE } },
{ "Bip01 R Hand", { SK_NONE, SK_NONE, SK_NONE, SK_NONE, SK_NONE } },
{ "Bip01 L Hand", { SK_NONE, SK_NONE, SK_NONE, SK_NONE, SK_NONE } },

// For box esp
{ "eyes bone", { SK_NECK, SK_NONE, SK_NONE, SK_NONE, SK_NONE } },
};
//////////////////////////////////////////////////

CAimbot::CAimbot( )
{
ZeroMemory( FrameTargets, sizeof( FrameTargets ) );
iNumFrameTargets = 0;
CurrentTarget = NULL;
LastTarget = NULL;

fPrediction = 0.0f;
}

CAimbot::~CAimbot( )
{
}

void CAimbot::PreFrame( const vec3_t vHitboxOffset,
const vec3_t vHitboxSize,
int headPoints, int bonePoints,
float prediction,
int priority,
float preAim,
bool ignoreGlass,
float fov_x, float fov_y )
{
bCanFire = false;
iNumFrameTargets = 0;
CurrentTarget = NULL;

fPrediction = prediction;
iHeadPoints = headPoints;
iBonePoints = bonePoints;
VectorCopy( vHitboxSize, vSize );
VectorCopy( vHitboxOffset, vVecs );
Priority = (AimPriority_t)priority;
fPreAim = preAim;
bIgnoreGlass = ignoreGlass;
fFovX = fov_x;
fFovY = fov_y;
}

void CAimbot::PostFrame( )
{
GetBestTarget( );
}

bool CAimbot::CanFire( )
{
return bCanFire;
}

bool CAimbot::PrioritizedTrace( player_t * Player )
{
switch( Priority )
{
case AIM_HEADBODY:
if( TraceHead( Player->HeadPoint, Player, iHeadPoints ) )
{
VectorCopy( Player->HeadPoint, Player->AimPoint );
return true;
}
else if( TraceSkeleton( Player->BodyPoint, Player ) )
{
VectorCopy( Player->BodyPoint, Player->AimPoint );
return true;
}
break;

case AIM_BODYHEAD:
if( TraceSkeleton( Player->BodyPoint, Player ) )
{
VectorCopy( Player->BodyPoint, Player->AimPoint );
return true;
}
else if( TraceHead( Player->HeadPoint, Player, iHeadPoints ) )
{
VectorCopy( Player->HeadPoint, Player->AimPoint );
return true;
}
break;

case AIM_HEADONLY:
if( TraceHead( Player->HeadPoint, Player, iHeadPoints ) )
{
VectorCopy( Player->HeadPoint, Player->AimPoint );
return true;
}
break;

case AIM_BODYONLY:
if( TraceSkeleton( Player->BodyPoint, Player ) )
{
VectorCopy( Player->BodyPoint, Player->AimPoint );
return true;
}
break;

default:
break;
}

return false;
}

bool CAimbot::GetBestTarget( )
{
int i;
player_t * Player;

std::sort( &FrameTargets[ 0 ], &FrameTargets[ iNumFrameTargets ], DistancePredicate );

for( i = 0; i < iNumFrameTargets; i++ )
{
Player = FrameTargets[ i ];

if( PrioritizedTrace( Player ) )
{
CurrentTarget = Player;
bCanFire = true;
break;
}
}

// Lock target here

if( !CurrentTarget )
{
if( fPreAim > 0.0f )
{
// Predict the future muzzle point
VectorMA( bot.muzzle, fPreAim, bot.cg->predictedPlayerState.velocity, bot.muzzle );

//fPrediction += fPreShoot; // Increase prediction for preshoot.. but not here, idiot!
for( i = 0; i < iNumFrameTargets; i++ )
{
Player = FrameTargets[ i ];

if( PrioritizedTrace( Player ) )
{
CurrentTarget = Player;
bCanFire = false; // don't pre-shoot
break;
}
}
//fPrediction -= fPreShoot;

// Restore the muzzle point
VectorMA( bot.muzzle, -fPreAim, bot.cg->predictedPlayerState.velocity, bot.muzzle );
}
}

return ( CurrentTarget != NULL );
}

void CAimbot::AddTarget( player_t * Player )
{
vec3_t vAngles;
if( Player->enemy )
{
// Calculate angles to head origin and check fov
GetTargetAngles( Player->orHead.origin, vAngles );

if( ( fabs( vAngles[PITCH] ) * 2 ) <= fFovY &&
( fabs( vAngles[YAW] ) * 2 ) <= fFovX )
{
FrameTargets[ iNumFrameTargets ] = Player;
iNumFrameTargets++;
}
}
}

bool CAimbot::Autoshoot( bool Toggle, bool Force )
{
if( Toggle )
{
if( bAutoshooting )
{
cgi.SendConsoleCommand( "-attack\n" );
bAutoshooting = false;
}
else
{
cgi.SendConsoleCommand( "+attack\n" );
bAutoshooting = true;
}
}
else
{
if( Force )
{
if( !bAutoshooting )
{
cgi.SendConsoleCommand( "+attack\n" );
bAutoshooting = true;
}
}
else
{
if( bAutoshooting )
{
cgi.SendConsoleCommand( "-attack\n" );
bAutoshooting = false;
}
}
}

return bAutoshooting;
}

bool CAimbot::Autoshooting( )
{
return bAutoshooting;
}

void CAimbot::Autocrouch( )
{
// Code me
}

float CAimbot::AngleDistance( player_t * Player )
{
// return ( Player->bestAngles[PITCH] * Player->bestAngles[PITCH] ) + ( Player->bestAngles[YAW] * Player->bestAngles[YAW] );
// Not included bestAngles yet
return 1.0f;
}

void CAimbot::DrawHeadbox( player_t * Player, bool bAxis )
{
vec3_t vOffset;

VectorMA( Player->orHead.origin, vVecs[0], Player->orHead.axis[0], vOffset );
VectorMA( vOffset, vVecs[1], Player->orHead.axis[1], vOffset );
VectorMA( vOffset, vVecs[2], Player->orHead.axis[2], vOffset );

//VectorMA( vOffset, fPrediction, Player->velocity, vOffset );

float * colour;

if( Player->enemy )
colour = ( Player->visible ) ? colorRed : colorRed_;
else
colour = ( Player->visible ) ? colorGreen : colorGreen_;

Bot_DrawBox( vOffset, Player->orHead.axis, vSize, colour, 3.0f, false );
}

bool CAimbot::GetBoneTag( player_t * Player, refEntity_t *re, int iBoneNum )
{
orientation_t or;
bonetag_t * bone = &Player->boneTags[ iBoneNum ];

if( bone->found )
return true;

if( Bot_GetTagAttached( skeleton[ iBoneNum ].tagname, re, &or ) )
{
// Get the position and velocity of the tag
VectorCopy( bone->origin, bone->oldorigin );
VectorCopy( or.origin, bone->origin );

vec3_t dx;
float dt;
VectorSubtract( bone->origin, bone->oldorigin, dx );
dt = ( bot.cg->time - bone->oldtime ) * 0.001f;
VectorScale( dx, ( ( dt > 0.0f ) ? ( 1 / dt ) : 0.0f ), bone->velocity );
bone->oldtime = bot.cg->time;

Bot_WorldToScreen( bone->origin, &bone->screenX, &bone->screenY );

bone->found = true;
return true;
}

return false;
}

void CAimbot::DrawSkeleton( player_t * Player, refEntity_t * re )
{
if( Player == NULL || re == NULL /*|| re->entityNumber >= MAX_CLIENTS*/ )
return;

for( int i = 0; i < SK_NUMPARTS; i++ )
{
if( GetBoneTag( Player, re, i ) )
{
for( int j = 0; j < 5; j++ )
{
int pairtag = skeleton[ i ].pairings[ j ];

if( pairtag == SK_NONE )
break;

if( GetBoneTag( Player, re, pairtag ) )
{
Bot_DrawLine( Player->boneTags[ i ].origin,
Player->boneTags[ pairtag ].origin,
colorWhite, 2.0f, false );
}
}
}
}
}

bool CAimbot::GetTargetAngles( int iAimType, vec3_t vOut )
{
if( iAimType == 0 )
return false;

// Switch different aim-types here (e.g. Instant, human, etc.)

if( !CurrentTarget )
return false;

return GetTargetAngles( CurrentTarget->AimPoint, vOut );
}

bool CAimbot::GetTargetAngles( const vec3_t vTarget, vec3_t vOut )
{
///////////////////////////////////////////////////////////////////
// I think credits go to RainerStoff and the ETH32 team for this //
///////////////////////////////////////////////////////////////////

vec3_t vDist;

VectorSubtract( vTarget, bot.muzzle, vDist );
vectoangles( vDist, vOut );

if( vOut[PITCH] > 180.0f ) vOut[PITCH] -= 360.0f;
else if( vOut[PITCH] < -180.0f ) vOut[PITCH] += 360.0f;
if( vOut[YAW] > 180.0f ) vOut[YAW] -= 360.0f;
else if( vOut[YAW] < -180.0f ) vOut[YAW] += 360.0f;

AnglesToAxis( vOut, bot.cg->refdef.viewaxis );

vOut[YAW] -= bot.cg->refdefViewAngles[YAW];
vOut[PITCH] -= bot.cg->refdefViewAngles[PITCH];

if( vOut[PITCH] > 180.0f ) vOut[PITCH] -= 360.0f;
else if( vOut[PITCH] < -180.0f ) vOut[PITCH] += 360.0f;
if( vOut[YAW] > 180.0f ) vOut[YAW] -= 360.0f;
else if( vOut[YAW] < -180.0f ) vOut[YAW] += 360.0f;

return true;
}

bool CAimbot::IsPointVisible( const vec3_t vEnd, int iSkipNumber )
{
return IsPointVisible( bot.muzzle, vEnd, iSkipNumber );
}

bool CAimbot::IsPointVisible( const vec3_t vStart, const vec3_t vEnd, int iSkipNumber )
{
trace_t t;

CG_Trace( &t, vStart, vec3_origin, vec3_origin, vEnd, iSkipNumber, MASK_SHOT, qfalse, qtrue, "IsPointVisible" );

return ( t.fraction == 1.0f ) || ( ( t.surfaceFlags & SURFACE_GLASS ) && bIgnoreGlass );
}

bool CAimbot::DistancePredicate1( BoxTrace_t &lhs, BoxTrace_t &rhs )
{
return ( lhs.d < rhs.d );
}

bool CAimbot::TraceHead( vec3_t vOut, player_t * Player, int iNumTraces )
{
return TraceHead( bot.muzzle, vOut, Player, iNumTraces );
}

bool CAimbot::TraceHead( const vec3_t vStart, vec3_t vOut, player_t * Player, int iNumTraces )
{
BoxTrace_t * TracePoints;
float fVolume = vSize[0] * vSize[1] * vSize[2];
vec3_t vEnd, vTrace;
int i;

VectorCopy( vec3_origin, vOut );
VectorMA( Player->orHead.origin, vVecs[0], Player->orHead.axis[0], vEnd );
VectorMA( vEnd, vVecs[1], Player->orHead.axis[1], vEnd );
VectorMA( vEnd, vVecs[2], Player->orHead.axis[2], vEnd );

if( VectorCompare( vec3_origin, vEnd ) )
return false;

// Apply prediction
VectorMA( vEnd, fPrediction, Player->velocity, vEnd );

if( IsPointVisible( vEnd, Player->clientNum ) ) // Trace center of head first
{
VectorCopy( vEnd, vOut );
return true;
}

TracePoints = new BoxTrace_t[ iNumTraces ];

// Generate random points within the hitbox volume
for( i = 0; i < iNumTraces; i++ )
{
VectorMA( vec3_origin, vSize[ 0 ] * ( random( ) - 0.5f ) * 0.5f, Player->orHead.axis[ 0 ], TracePoints[ i ].pt );
VectorMA( TracePoints[ i ].pt, vSize[ 1 ] * ( random( ) - 0.5f ) * 0.5f, Player->orHead.axis[ 1 ], TracePoints[ i ].pt );
VectorMA( TracePoints[ i ].pt, vSize[ 2 ] * ( random( ) - 0.5f ) * 0.5f, Player->orHead.axis[ 2 ], TracePoints[ i ].pt );

TracePoints[ i ].d = VectorLengthSquared( TracePoints[ i ].pt );
}
// Sort the points by the distance from the center of the head for accuracy
std::sort( &TracePoints[ 0 ], &TracePoints[ iNumTraces ], DistancePredicate1 );

for( i = 0; i < iNumTraces; i++ )
{
VectorAdd( vEnd, TracePoints[ i ].pt, vTrace );

if( IsPointVisible( vTrace, Player->clientNum ) )
{
VectorCopy( vTrace, vOut );

delete TracePoints;

return true;
}
}

delete TracePoints;

return false;
}

bool CAimbot::TraceSkeleton( vec3_t vOut, player_t * Player )
{
return TraceSkeleton( bot.muzzle, vOut, Player );
}

bool CAimbot::TraceSkeleton( const vec3_t vStart, vec3_t vOut, player_t * Player )
{
vec3_t vDiv, vCurrent, vPredicted;
refEntity_t * re = cgi.R_GetRenderEntity( Player->clientNum );

VectorMA( re->origin, fPrediction, Player->velocity, vPredicted );

// Don't bother traceing the eyes
for( int i = 0; i < SK_EYES; i++ )
{
if( GetBoneTag( Player, re, i ) )
{
if( IsPointVisible( Player->boneTags[ i ].origin, Player->clientNum ) )
{
VectorCopy( Player->boneTags[ i ].origin, vOut );

return true;
}

if( iBonePoints ) //iBonePoints==0 for tag aiming instead of bone aiming
{
for( int j = 0; j < 5; j++ )
{
int pairnum = skeleton[ i ].pairings[ j ];

if( pairnum == SK_NONE )
break;

if( GetBoneTag( Player, re, pairnum ) )
{
VectorSubtract( Player->boneTags[ pairnum ].origin, Player->boneTags[ i ].origin, vDiv );
VectorScale( vDiv, (float)( 1 / ( iBonePoints + 1 ) ), vDiv );
VectorCopy( Player->boneTags[ i ].origin, vCurrent );

for( int k = 0; k < iBonePoints; k++ )
{
VectorAdd( vDiv, vCurrent, vCurrent );

if( IsPointVisible( vCurrent, Player->clientNum ) )
{
VectorCopy( vCurrent, vOut );

return true;
}
}
}
}
}
}
}

return false;
}

/*static*/ bool CAimbot::DistancePredicate( player_t * &lhs, player_t * &rhs )
{
return ( lhs->distance < rhs->distance );
}

#pragma warning ( default : 4244 )

REGARD BOH3mia
Posted by alpha111
Apr 09, 2010 4:22 PM