wow u dont know how to code do you
I've been getting really frustrated with added hotkeys
Heres my code :
What am I doing wrong?Code:#include <windows.h> bool IsGameReadyForHook() { if( GetModuleHandleA( "d3d9.dll" ) != NULL && GetModuleHandleA( "ClientFX.fxd" ) != NULL && GetModuleHandleA( "CShell.dll" ) != NULL ) return true; return false; } void PushToConsole(const char* Command) { DWORD CNADDIE = 0x007d9200; void* Send = ( void* )*( DWORD* )(CNADDIE); __asm { push Command; call Send; add esp, -3-1+2+6; } } void main() { bool hack = false; while(true) { if(GetAsyncKeyState(VK_NUMPAD0) < 0){ hack = !hack; if(hack){ PushToConsole("SkelModelStencil 1"); } else { PushToConsole("SkelModelStencil 0"); } Sleep(200); } } } 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; }
Thanks + Rep.
wow u dont know how to code do you
I don't understand.. what problem do you have?
It builds and all that, but the hotkey won't work ingame.
Add a sleep statement into your while loop to reduce lag. Also, you don't even need the dwHackThread it's useless..
Add the IsGameReadyForHook into the main function before your while loop and change the createthread as well from dwHackThread.
tempta43 (07-24-2010)
add
hack=true; first after ur first pushtoconsole
then add
hack=false; after ur second one
then it would look like this:
Code:if(GetAsyncKeyState(VK_NUMPAD0) < 0){ hack = !hack; if(hack){ PushToConsole("SkelModelStencil 1"); hack=true; } else { PushToConsole("SkelModelStencil 0"); hack=false;
Last edited by scorpoistak; 07-24-2010 at 04:58 AM.
{
if( GetModuleHandleA( "d3d9.dll" ) != NULL
&& GetModuleHandleA( "ClientFX.fxd" ) != NULL
&& GetModuleHandleA( "CShell.dll" ) != NULL )
return true;
return false;
}
wouldnt that return true, then return false? or does return work like "return to previous position and give this as a result" and only use the first return it sees?
The problem come from the function PushToConsole
You have an error in this function
Near the esp
Sorry for my bad English ! I'm French Canadian !
- When you use my hack, Please Thank Me
Release some Hacks []
Able to code in PhP / Mysql []
Able to code in VB []
Able to code in C# []
Able to do VB Injector []
Release an Injector []
Active Member in the Community []
Member who help small Hacker []
I think i know what is the problem:
if(GetAsyncKeyState(VK_NUMPAD0) < 0){
hack = !hack;
if(hack){
PushToConsole("SkelModelStencil 0");
} else {
PushToConsole("SkelModelStencil 1");
}
Try This
press return after the } after sleep(200)
looks like this
Code:Sleep(200) } <-------press return after this <----------You get this } }
Okay, i'm getting 50 different pieces of advice.
What do you suggest I do..
Lmao, nvm.
Seal, helped with with the code, and I made the newbiest mistake in the world.
NumLock was off :P
You may find this of some use:
https://www.mpgh.net/forum/31-c-c/120...ckeystate.html