Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QAngle angle;
- QAngle m_ViewAngle;
- QAngle OldAngle;
- float smooth = 2;
- DWORD lastClick = 0;
- void __fastcall hkPaintTraverse ( void* ecx, void* edx, unsigned int vguiPanel, bool forceRepaint, bool allowForce )
- {
- oPaintTraverse ( ecx, vguiPanel, forceRepaint, allowForce );
- static DWORD lastShoot = 0;
- if ( engine->IsInGame ( ) && engine->IsConnected ( ) && !engine->IsTakingScreenshot ( ) )
- {
- if ( GetAsyncKeyState ( 6 ) )
- {
- if ( triggerBot ( ) )
- {
- DWORD currentCount = GetTickCount ( );
- if ( currentCount - lastShoot > 20 )
- {
- LeftClick ( );
- lastShoot = currentCount;
- }
- }
- }
- C_BaseEntity *pLocalEntity = ( C_BaseEntity* )entitylist->GetClientEntity ( engine->GetLocalPlayer ( ) );
- if ( !pLocalEntity )
- return;
- for ( int i = 0; i < entitylist->GetHighestEntityIndex ( ); i++ ) //spotter
- {
- C_BaseEntity* pBaseEntity = ( C_BaseEntity* )entitylist->GetClientEntity ( i );
- if ( !pBaseEntity )
- continue;
- if ( pBaseEntity->health ( ) < 1 )
- continue;
- if ( pBaseEntity == pLocalEntity )
- continue;
- if ( pLocalEntity->team ( ) == pBaseEntity->team ( ) )
- continue;
- *( BYTE* )( ( DWORD )pBaseEntity + spotOffset ) = 1;
- }
- if ( GetAsyncKeyState ( VK_INSERT ) )
- {
- DWORD tick = GetTickCount ( );
- if ( tick - lastClick > 100 )
- {
- smooth += 1;
- g_pCVar->ConsoleColorPrintf ( Color::Red ( ), "Current smooth: %f\n", smooth );
- lastClick = tick;
- }
- }
- if ( GetAsyncKeyState ( VK_DELETE ) )
- {
- DWORD tick = GetTickCount ( );
- if ( tick - lastClick > 100 )
- {
- smooth -= 1;
- g_pCVar->ConsoleColorPrintf ( Color::Red ( ), "Current smooth: %f\n", smooth );
- lastClick = tick;
- }
- }
- if ( GetAsyncKeyState ( VK_LBUTTON ) )
- {
- if ( *( DWORD* )( ( DWORD )pLocalEntity + shotsFiredOffset ) > 1 )
- {
- if ( smooth < 1 )
- smooth = 1;
- if ( smooth > 99 )
- smooth = 99;
- QAngle tmp;
- engine->GetViewAngles ( tmp );
- m_ViewAngle = tmp;
- QAngle* m_PunchAngle = pLocalEntity->GetAimPunchPtr ( );
- if ( !m_PunchAngle )
- return;
- //g_pCVar->ConsolePrintf ( "PunchAngles: %f %f\n", m_PunchAngle->x, m_PunchAngle->y );
- m_ViewAngle.x = m_ViewAngle.x + OldAngle.x;
- m_ViewAngle.y = m_ViewAngle.y + OldAngle.y;
- // Add the old "viewpunch" so we get the "center" of the screen again
- angle.x = m_ViewAngle.x - m_PunchAngle->x * 2.0f;
- angle.y = m_ViewAngle.y - m_PunchAngle->y * 2.0f;
- // remove the new "viewpunch" from the viewangles
- QAngle delta = tmp - angle;
- angle = tmp - delta / ( 100.0f - smooth );
- normalizeAngle ( angle );
- //g_pCVar->ConsolePrintf ( "OriginalAngles: %f %f\nSetting angles to %f %f\n", m_ViewAngle.x, m_ViewAngle.y, angle.x, angle.y );
- engine->SetViewAngles ( angle );
- OldAngle.x = m_PunchAngle->x * 2;
- OldAngle.y = m_PunchAngle->y * 2;
- // save the old angle
- } else
- {
- OldAngle.x = 0;
- OldAngle.y = 0;
- }
- } else
- {
- OldAngle.x = 0;
- OldAngle.y = 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement