Help :) - Ca Pub Fix

Posts 1–8 of 8 · Page 1 of 1
Help :) - Ca Pub Fix
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;
}
you will have to add a bool to confirm whenever you pressed to turn on or off.. and then get the code on an "if ()" verifying if the bool is true or not.

Im not giving you the code for that.. its simple enough
[php]if(GetAsyncKeyState(VK_NUMPAD1)<0){
PushToConsole("SkelModelStencil -1"); //Nx Chams
}else{
PushToConsole("SkelModelStencil 0"); //Deactivate Nx Chams
}[/php]

shud be

[php]if(GetAsyncKeyState(VK_NUMPAD1)<0){
PushToConsole("SkelModelStencil 1"); //Nx Chams
}else{
PushToConsole("SkelModelStencil 0"); //Deactivate Nx Chams
}[/php]
Like Brinuz said.

[php]

bool chams = false;
void HotkeyCheck()
{
while(true)
{
if(GetAsyncKeyState(VK_F1))
{
chams = !chams;
Sleep(200);
}
}
}
[/php]


[php]void HackThread()
{
while(true)
{
if(chams)
{
// activate chams
} else {
// deactivate chams
}
}
}[/php]

Then create separate threads for each function.
@ void: why not

Code:
void ILeechMyHacks()
{
    bool chams = false;
    while(1337>707)
    {
        if(GetAsyncKeyState(VK_F1) & 1)
        {
            chams = !chams;
        }
        switch(chams)
        {
        case true:
            //cham
            break;
        case false:
            //uncham
            break;
        }
        Sleep(20);
    }
}
Quote Originally Posted by Hell_Demon View Post
@ void: why not

Code:
void ILeechMyHacks()
LMFAO .
[php]

if(GetAsyncKeyState(VK_NUMPAD1)<0){
PushToConsole("SkelModelStencil -1"); //Nx Chams
}else{
PushToConsole("SkelModelStencil 0"); //Deactivate Nx Chams
}

[/php]

Lets just take a look at this, what this piece of code here is saying is

if numpad1 is being pressed

then cham

if it isn't

don't cham


[php]

if numpad1 was pressed and cham = false

cham


if numpad 1 is was pressed and cham = true

uncham

[/php]

This code is saying

if numpad1 WAS pressed AND cham ISN'T on

turn chams on

if numpad1 WAS pressed AND cham IS on

turn chams off


I don't know how to code, but I know that would work... If you can figure out how to do that.


And this is just a WILD guess at the code here, but since I don't know bools I would declare an int

basically like this


[php]
#include <windows.h>
bool IsGameReadyForHook()
int chams; //wherever a variable should go... don't understand bool.
{
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) && cham == 0){ /* is there a way to get it to register when the key was pressed, not while its being held down? because I can see this leading to it rapidly turning on and off when you push the button*/
PushToConsole("SkelModelStencil -1"); //Nx Chams
//make int cham == 1... however you do that, I only know how with cin.
}else if(getAsyncKeySate(VK_NUMPAD1)<0) && cham == 1){
PushToConsole("SkelModelStencil 0"); //Deactivate Nx Chams
//make int cham == 0... however you do that without cin
}
endif //if this isn't actually code, use whatever you can to end this if statement
[/php]

I went ahead and commented where some things might need to be fixed,
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?