OpenGL CG

luckie123

New member
Hello everyone!

I made my own wallhack for cod1 and it finally works no crashes no lag,
but im trying to make a no recoil hack, i see alot of treaths saying to use CG_Fireweapon
But how do i declare the CG function? because i get errors when putting in the CG_Fireweapon function

Example:

Code:
void CG_FireWeapon( centity_t *cent ) {

    //REMOVED USELESS CRAP



    if ( ent->weapon >= WP_NUM_WEAPONS ) {

        CG_Error( "CG_FireWeapon: ent->weapon >= WP_NUM_WEAPONS" );

        return;

    }

    weap = &cg_weapons[ ent->weapon ];

    cg.lastFiredWeapon = ent->weapon;    //----(SA)    added

    // mark the entity as muzzle flashing, so when it is added it will

    // append the flash to the weapon model

    cent->muzzleFlashTime = cg.time;

    // RF, kick angles

    if (ent->number == cg.snap->ps.clientNum) {

        CG_WeaponFireRecoil( ent->weapon );  // This would usually be what we want to change..

    }

So anyone can help declare it?

Thanx

-luckie :FastDanceBan:
 

mowl

Coders
Nop the call, or hook CG_WeaponFireRecoil.

Code:
void CG_WeaponFireRecoil( DWORD arg ) { return; }
 

luckie123

New member
this is what i have now

Code:
/*no-recoil*/

void CG_WeaponFireRecoil( DWORD arg ) { return; }


void CG_FireWeapon( centity_t *cent ) {

    //REMOVED USELESS CRAP



    if ( ent->weapon >= WP_NUM_WEAPONS ) {

        CG_Error( "CG_FireWeapon: ent->weapon >= WP_NUM_WEAPONS" );

        return;

    }

    weap = &cg_weapons[ ent->weapon ];

    cg.lastFiredWeapon = ent->weapon;    //----(SA)    added

    // mark the entity as muzzle flashing, so when it is added it will

    // append the flash to the weapon model

    cent->muzzleFlashTime = cg.time;

    // RF, kick angles

    if (ent->number == cg.snap->ps.clientNum) {

        CG_WeaponFireRecoil( ent->weapon );  // This would usually be what we want to change..

    }

still same errors :(
 

uNhoL

New member
You don't know shit about making hacks, do you?

Well I hope this helps you out a bit. Find CG_WeaponFireRecoil function's offset by disassembling the cgame file. Now you need to make a function that will be called before original one,
Code:
void CG_WeaponFireRecoil( int w ) { return; }
Then you need to hook the original function so your function is ran before original one
Code:
// Do this when cgame gets loaded
DetourFunction((PBYTE) ORIGINAL_WEAPON_FIRE_RECOIL_ADDRESS, (PBYTE) CG_WeaponFireRecoil );
And now you shouldn't have weapon fire recoil. DetourFunction makes the original function run your own function before the original one.

I hope this helped a bit but as I am busy atm I can't explain every single step. Feel free to post whatever you didn't understand.
 

Seraphim

Moderator
He doesn't know how to code, you're wasting your time unhol.

Luckie, you need to read up on how to use a disassembler, how to use C and C++, and then come back. You'll understand over half of what you're asking then.
 
Top