Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Aimbot is fully INVISIBLE in killcams and spectators and on your screen.
- void GetRandomFloats(int seed, float* fl1, float* fl2)
- {
- _asm push fl2
- _asm push fl1
- _asm push seed
- _asm mov eax, 0x4a66e0
- _asm call eax
- _asm add esp, 0xc
- }
- void GetWeaponSpread ( weapon_t* pWeapon, float* WeaponSpread )
- {
- DWORD CalculateWeaponSpread = 0x416C70;
- float MaxSpread = 0.0f;
- float BaseSpread = 0.0f;
- float SpreadMultiplier = 0.0f;
- _asm mov ecx, dword ptr ds: [ pWeapon ];
- _asm mov edx, 0x794474;
- _asm lea edi, dword ptr ds: [ BaseSpread ];
- _asm lea esi, dword ptr ds: [ MaxSpread ];
- _asm call dword ptr ds: [ CalculateWeaponSpread ];
- _asm fld dword ptr ds: [ 0x84CAA0 ];
- _asm fdiv qword ptr ds: [ 0x70AEE0 ];
- _asm fstp dword ptr ds: [ SpreadMultiplier ];
- *WeaponSpread = BaseSpread + ( ( MaxSpread - BaseSpread ) * SpreadMultiplier );
- }
- weapon_t* GetPlayerWeapon( int iIndex )
- {
- return (( weapon_t** ) 0x736DB8 )[iIndex];
- }
- VOID CorrectSpread( )
- {
- if(cg->snap)
- {
- input_t* input = (input_t*)0xcc4ff8;
- usercmd_t * cmd = input->GetUserCmd( input->currentCmdNum - 1);
- cmd->servertime = *(int*)0x794464 + 1;
- FirstBulletFix();//from king-orgy can be found on UC at cod4 section
- Vector3 ForwardVec, RightVec, UpVec, CalculatedSpreadView, SpreadView, DestinationVec;
- int seed = *(int*)0x794474;
- Vector3 vWeaponAngles;
- GetWeaponView( vWeaponAngles );
- CMath.NSAngleVectors( vWeaponAngles, ForwardVec, RightVec, UpVec );
- float flSpread;
- weapon_t * pWeapon = GetPlayerWeapon( cg_entities2[cg->clientNum].nWeaponID );
- GetWeaponSpread( pWeapon, &flSpread );
- flSpread *= 0.01745329238474369f;
- flSpread = tan(flSpread) * 8192.0f;
- float flSpreadRight, flSpreadUp;
- Vector3 myViewpoint = {0, 0, 0 };
- GetViewPoint ( myViewpoint );
- GetRandomFloats( seed, &flSpreadRight, &flSpreadUp );
- flSpreadRight *= flSpread;
- flSpreadUp *= flSpread;
- SpreadView[ 0 ] = myViewpoint[ 0 ] + ForwardVec[ 0 ] * 8192 + RightVec[ 0 ] * flSpreadRight + UpVec[ 0 ] * flSpreadUp;
- SpreadView[ 1 ] = myViewpoint[ 1 ] + ForwardVec[ 1 ] * 8192 + RightVec[ 1 ] * flSpreadRight + UpVec[ 1 ] * flSpreadUp;
- SpreadView[ 2 ] = myViewpoint[ 2 ] + ForwardVec[ 2 ] * 8192 + RightVec[ 2 ] * flSpreadRight + UpVec[ 2 ] * flSpreadUp;
- CalculatedSpreadView[ 0 ] = SpreadView[ 0 ] - myViewpoint[ 0 ];
- CalculatedSpreadView[ 1 ] = SpreadView[ 1 ] - myViewpoint[ 1 ];
- CalculatedSpreadView[ 2 ] = SpreadView[ 2 ] - myViewpoint[ 2 ];
- CMath.NSVectorAngles( CalculatedSpreadView, DestinationVec );
- Vector3 FinalVecAngles;
- DestinationVec[ 0 ] *= -1;
- FinalVecAngles[ 0 ] = viewMatrix->viewAngles[ 0 ] - DestinationVec[ 0 ];
- FinalVecAngles[ 1 ] = viewMatrix->viewAngles[ 1 ] - DestinationVec[ 1 ];
- FinalVecAngles[ 2 ] = 0;
- if ( !clientInfo[cg->clientNum].zoomed )// WE NEED DO IT ONLY WHEN NOT ZOOMED
- {
- cmd->viewangles[ 0 ] += ANGLE2SHORT( FinalVecAngles[ 0 ] );
- cmd->viewangles[ 1 ] += ANGLE2SHORT( FinalVecAngles[ 1 ] );
- cmd->viewangles[ 2 ] += ANGLE2SHORT( FinalVecAngles[ 2 ] );
- }
- //viewangles->ViewAngle[ 0 ] -= vFinalSpreadAngles[ 0 ];
- //viewangles->ViewAngle[ 1 ] -= vFinalSpreadAngles[ 1 ];
- }
- }
- call CorrectSpread(); in writepacket or cg_predictedplayerstate.
- void ( *orig_CG_PredictPlayerState )( int unk );
- void CG_PredictPlayerState_Hook( int unk )
- {
- orig_CG_PredictPlayerState( unk );
- clientInfo_t * pLocal = &clientInfo( cg->clientNum );
- centity_t *pLocalEntity = &cg_entities[ cg->clientNum];
- if( pLocalEntity != 0 && pLocalEntity->currentValid && ( ( pLocalEntity->eState.isAlive ) & 1 ) && pLocal != 0 )
- {
- CorrectSpread();
- }
- }
- DetourFunction( ( PBYTE )0x447260, ( PBYTE )&CG_PredictPlayerState );
- __asm mov [ orig_CG_PredictPlayerState ], eax;
- credits: crazyninja, x22, chod, crx, unreal
- [Auto Merged - 11:51:57 UTC]
- and to make full silent aim off it add this
- if(cvar.silentaim)
- {
- cmd->viewangles[ 0 ] += ANGLE2SHORT( stealthAimAngles[ 0 ] );
- cmd->viewangles[ 1 ] += ANGLE2SHORT( stealthAimAngles[ 1 ] );
- cmd->viewangles[ 2 ] += ANGLE2SHORT( stealthAimAngles[ 2 ] );
- }
- below
- cmd->viewangles[ 2 ] += ANGLE2SHORT( FinalVecAngles[ 2 ] );
- float stealthAimAngles[3];
- and in aimbot
- CMath.GetAngleToOrigin( vOrg, ViewAngle[ 0 ], ViewAngle[ 1 ] );
- if ( cvar.silentaim )
- {
- stealthAimAngles[ 0 ] = ViewAngle[ 1 ];
- stealthAimAngles[ 1 ] = ViewAngle[ 0 ];
- stealthAimAngles[ 2 ] = 0;
- }
- else
- {
- /*D3DXVECTOR3 CalculatedPos;
- CalculatedPos = *(D3DXVECTOR3*)&vOrg - *(D3DXVECTOR3*)&camera->Location;
- D3DXVec3Normalize( &CalculatedPos, &CalculatedPos );
- viewangles->ViewAngle[ 1 ] += D3DXToDegree( asin( D3DXVec3Dot((D3DXVECTOR3*)&camera->ViewMatrix[ 1 ], &CalculatedPos )));
- viewangles->ViewAngle[ 0 ] -= D3DXToDegree( asin( D3DXVec3Dot((D3DXVECTOR3*)&camera->ViewMatrix[ 2 ], &CalculatedPos )));*/
- viewangles->ViewAngle[ 1 ] += ViewAngle[ 0 ];
- viewangles->ViewAngle[ 0 ] += ViewAngle[ 1 ];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement