I used CoderNever's Tutorial and began my journey to be like the other 84,360+ people who have released a public hack for CA NA.
I then added the Updated LT Client, Courtesy of Blood's thread.
After that was all done, I Began adding PTC Commands from the "Mega Thread" of them.
I figured just puting the commands in there would make everything "Auto-On"
So I proceeded to Google, How to make Hotkey's in C++... After browsing a little I came to find a thread on this very site. I now Incorporated his Hotkey method, and am very successfull except for one problem.
Mostly all of the PTC Commands I've included work when I press the hotkey, But only when the Hotkey is pressed down..
So my Nx Chams only appear when I press , Numpad 1 , and when I release they disappear.
I seek your coding expertise.
Code:
#include <windows.h>
bool IsGameReadyForHook()
{
if( GetModuleHandleA( "d3d9.dll" ) != NULL
&& GetModuleHandleA( "ClientFX.fxd" ) != NULL
&& GetModuleHandleA( "CShell.dll" ) != NULL )
return true;
return false;
}
void __cdecl PushToConsole( const char* szCommand )
{
DWORD *LTClient = ( DWORD* )( 0x3778CFB0 );
void* CONoff = ( void* )*( DWORD* )( *LTClient + 0x208 );
__asm
{
push szCommand;
call CONoff;
add esp, 4;
}
}
void main()
{
while(true)
{
if(GetAsyncKeyState(VK_NUMPAD1)<0){
PushToConsole("SkelModelStencil -1"); //Nx Chams
}else{
PushToConsole("SkelModelStencil 0"); //Deactivate Nx Chams
}
if(GetAsyncKeyState(VK_NUMPAD2)<0){
PushToConsole("ShowFirePath 1"); //Bullet Tracers
}else{
PushToConsole("ShowFirePath 0"); //Deactivate Bullet tracers
}
if(GetAsyncKeyState(VK_NUMPAD3)<0){
PushToConsole("windowed 1"); //Window Mode
PushToConsole("CursorCenter 1"); //Unlock Cursor
}else{
PushToConsole("windowed 0"); //Deactivate Window Mode
PushToConsole("CursorCenter 0"); //Deactivate Unlock Cursor
}
if(GetAsyncKeyState(VK_NUMPAD4)<0){
PushToConsole("ShowFps 1"); //Show Fps
}else{
PushToConsole("ShowFps 0"); // Deactivate Show Fps
}
if(GetAsyncKeyState(VK_NUMPAD5)<0){
PushToConsole("drawguns 1"); //Hide Guns
}else{
PushToConsole("drawguns 0"); //Deactivate Draw Guns
}
if(GetAsyncKeyState(VK_NUMPAD6)<0){
PushToConsole("FogEnable 1"); //No Fog
}else{
PushToConsole("FogEnable 0"); //Deactivate No Fog
}
if(GetAsyncKeyState(VK_NUMPAD7)<0){
PushToConsole("ModelDebug_DrawBoxes 1"); //ESP Box **Possibly not working.
}else{
PushToConsole("ModelDebug_DrawBoxes 0"); //Deactivate ESP Box **Possibly not working.
}
if(GetAsyncKeyState(VK_NUMPAD8)<0){
PushToConsole("PlayerGravity -1000"); //Fly Hack
}else{
PushToConsole("PlayerGravity 0"); //Possibly Disable Fly Hack
}
if(GetAsyncKeyState(VK_NUMPAD9)<0){
PushToConsole("ActivationDistance 999999"); //Pickup Further
}else{
PushToConsole("ActivationDistance 250"); //Disable Pickup Further
}
if(GetAsyncKeyState(VK_UP)<0){
PushToConsole("WireFrame 1"); //WireFrame Map
}else{
PushToConsole("WireFrame 0"); //Disable WireFrame Map
}
if(GetAsyncKeyState(VK_DOWN)<0){
PushToConsole("WireframeModels 1"); //WireFrame People
}else{
PushToConsole("WireframeModels 0"); //Disable WireFrame People
}
if(GetAsyncKeyState(VK_RIGHT)<0){
PushToConsole("FullBright 1"); //FullBright
}else{
PushToConsole("FullBright 0"); //Disable FullBright
}
if(GetAsyncKeyState(VK_LEFT)<0){
PushToConsole("JumpVel 600.000000"); //Jump Hack
}else{
PushToConsole("JumpVel 100.000000"); //Disable Jump Hack
}
if(GetAsyncKeyState(VK_DELETE)<0){
PushToConsole("FragSelf 1"); //Suicide
}
if(GetAsyncKeyState(VK_INSERT)<0){
PushToConsole("CamMaxposYOffset 200.000000"); //Virtual Jump up
}else{
PushToConsole("CamMaxposYOffset 0.000000"); //Disable Vjump up
}
if(GetAsyncKeyState(VK_HOME)<0){
PushToConsole("CamMaxposYOffset -1000.000000"); //Virtual Jump down
}else{
PushToConsole("CamMaxposYOffset 0.000000"); //Disable Vjump down
}
if(GetAsyncKeyState(VK_F12)<0){ //NoSpread
PushToConsole("PerturbRotationEffect 0.000000" );
PushToConsole("PerturbIncreaseSpeed 0.000000" );
PushToConsole("PerturbWalkPercent 0.000000" );
PushToConsole("PerturbFiringIncreaseSpeed 0.000000" );
PushToConsole("PerturbRecoil 0.000000" );
PushToConsole("FireMovePerturb 0.000000" );
PushToConsole("ZoomedFireMoveDuckPerturb 0.000000" );
PushToConsole("ZoomedFireMovePerturb 0.000000" );
PushToConsole("ZoomedFireDuckPerturb 0.000000" );
}
}
}
DWORD WINAPI dwHackThread(LPVOID)
{
while( !IsGameReadyForHook() )
Sleep(100);
main();
return 0;
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH )
{
CreateThread(NULL, NULL, dwHackThread, NULL, NULL, NULL);
}
return TRUE;
}