Results 1 to 8 of 8
  1. #1
    childscoke's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    162
    Reputation
    10
    Thanks
    14

    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;
    }
    [IMG]https://i260.photobucke*****m/albums/ii14/wyfidouble/CoderNever.gif[/IMG]


    HTC EVO 4G USER

  2. #2
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    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
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  3. #3
    iFuSiiiOn's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    My Mood
    Yeehaw
    nice kool keep it up

  4. #4
    Fabolous's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    192.168.1.01
    Posts
    2,704
    Reputation
    261
    Thanks
    682
    My Mood
    Paranoid
    [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]

  5. The Following User Says Thank You to Fabolous For This Useful Post:

    childscoke (08-03-2010)

  6. #5
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    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.

  7. The Following User Says Thank You to Void For This Useful Post:

    Melodia (08-03-2010)

  8. #6
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,321
    My Mood
    Cheeky
    @ 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);
        }
    }
    Ah we-a blaze the fyah, make it bun dem!

  9. The Following User Says Thank You to Hell_Demon For This Useful Post:

    Void (08-04-2010)

  10. #7
    Fabolous's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    192.168.1.01
    Posts
    2,704
    Reputation
    261
    Thanks
    682
    My Mood
    Paranoid
    Quote Originally Posted by Hell_Demon View Post
    @ void: why not

    Code:
    void ILeechMyHacks()
    LMFAO .

  11. #8
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love
    [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,
    Last edited by VvITylerIvV; 08-04-2010 at 12:37 AM.
    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL

Similar Threads

  1. Help with Pub hack on Vista
    By kcrisher in forum Combat Arms Hacks & Cheats
    Replies: 16
    Last Post: 01-28-2009, 10:23 AM
  2. Help with Pub Hacks!
    By Umpalumpa in forum Combat Arms Europe Hacks
    Replies: 3
    Last Post: 01-27-2009, 02:25 PM
  3. Need Help with Pub Hacks
    By andreskilled in forum Combat Arms Hacks & Cheats
    Replies: 0
    Last Post: 01-10-2009, 02:22 AM
  4. Help MPGH Pub Hack Error
    By ALLCAPONE in forum Combat Arms Hacks & Cheats
    Replies: 7
    Last Post: 01-03-2009, 11:47 AM
  5. [HELP] CA Pub Dont work all the sudden
    By i7vSa7vi7y in forum Combat Arms Hacks & Cheats
    Replies: 12
    Last Post: 08-20-2008, 07:26 PM