Post: [SPRX/C++] CG_Trace (Alternate to AimTarget_IsTargetVisible)
09-05-2016, 06:29 AM #1
gopro_2027
Vault dweller
(adsbygoogle = window.adsbygoogle || []).push({}); My old source code for my private mw2 menu was lost on my corrupted harddrive so I have no motive to recreate a whole menu.
However, I did recently find CG_Trace address. I also found a forum post on another site on how to use CG_Trace to simulate AimTarget_IsTargetVisible.
I might just use snow engine and add it in idk. This should be public anyways.
You must login or register to view this content.
Have fun.

EDIT: I have found CG_CanSeeFriendlyHead but it works... very shittily. It doesn't seem to always recognize it properly. I think I also need to patch the function to work in 360 degrees and not just on my screen but otherwise I combined it with always shoot at visible but if no players are visible (or at least, it thinks none are) then to aim at the nearest and it seems to be a little bit more fluid and working but still not the bo2 style aimbot I want. If anybody knows how to patch it to make it work in 360 that would be great. I also think I found AImTarget_IsTargetVisible but according to sc58 it is like inside of a parent function or something so I haven't bothered to try it yet.
Last edited by gopro_2027 ; 09-08-2016 at 04:53 AM.

The following 3 users say thank you to gopro_2027 for this useful post:

Elemxnt, filon1001, lucasaf01
09-05-2016, 08:07 PM #2
Cynia
Save Point
Thx, sir. Kryptus
09-05-2016, 08:59 PM #3
filon1001
Bounty hunter
Thank Pug
09-06-2016, 04:54 AM #4
Thank you for releasing this c:
09-07-2016, 10:00 PM #5
gopro_2027
Vault dweller
Originally posted by Elemxnt View Post
Thank you for releasing this c:


Originally posted by filon1001 View Post
Thank Pug


Originally posted by Cynia View Post
Thx, sir. Kryptus


I am having trouble getting it working though. If any of you can help me get it working I also have CG_LocationalTrace and CG_TraceCapsule and CG_PointTraceToEntities.
09-09-2016, 09:28 AM #6
TheGreenPlanet
Do a barrel roll!
Originally posted by 2027 View Post
My old source code for my private mw2 menu was lost on my corrupted harddrive so I have no motive to recreate a whole menu.
However, I did recently find CG_Trace address. I also found a forum post on another site on how to use CG_Trace to simulate AimTarget_IsTargetVisible.
I might just use snow engine and add it in idk. This should be public anyways.
You must login or register to view this content.
Have fun.

EDIT: I have found CG_CanSeeFriendlyHead but it works... very shittily. It doesn't seem to always recognize it properly. I think I also need to patch the function to work in 360 degrees and not just on my screen but otherwise I combined it with always shoot at visible but if no players are visible (or at least, it thinks none are) then to aim at the nearest and it seems to be a little bit more fluid and working but still not the bo2 style aimbot I want. If anybody knows how to patch it to make it work in 360 that would be great. I also think I found AImTarget_IsTargetVisible but according to sc58 it is like inside of a parent function or something so I haven't bothered to try it yet.


CG_CanSeeFriendly doesnt work for MW2 because its inside CG_DrawFriendlyNames by my knowledge(0x48600) I used FX_GetClientVisibility to reverse it and it didnt xref to it. If your having problems reversing refdef struct you can use CG_GetPlayerViewOrigin (cant really remember what the name was) although its a pain in the ass reversing it. And it has the same params as the G_GetPlayerViewOrigin function. If you didnt know I posted the CG_CanSee... for BO1 In the Addresses and scripts thread if your still interested in updating the Snow Engine Edit. Btw Use CG_LocationalTrace instead of CG_trace, its easier.
CG_Trace: 0x95EC8//If any1 wants it
Last edited by TheGreenPlanet ; 09-09-2016 at 09:33 AM.
09-09-2016, 11:08 PM #7
gopro_2027
Vault dweller
Originally posted by TheGreenPlanet View Post
CG_CanSeeFriendly doesnt work for MW2 because its inside CG_DrawFriendlyNames by my knowledge(0x48600) I used FX_GetClientVisibility to reverse it and it didnt xref to it. If your having problems reversing refdef struct you can use CG_GetPlayerViewOrigin (cant really remember what the name was) although its a pain in the ass reversing it. And it has the same params as the G_GetPlayerViewOrigin function. If you didnt know I posted the CG_CanSee... for BO1 In the Addresses and scripts thread if your still interested in updating the Snow Engine Edit. Btw Use CG_LocationalTrace instead of CG_trace, its easier.
CG_Trace: 0x95EC8//If any1 wants it


I posted CG_Trace in the pastebin link. That was the whole point lol. And I did get CG_CanSeeFriendlyHead working in mw2

EDIT:
FX_GetClientVisibility is in CG_CanSeeFriendlyHead in MW2. You must have had the wrong FX_GetClientVisibility
Last edited by gopro_2027 ; 09-09-2016 at 11:11 PM.
09-10-2016, 12:41 PM #8
TheGreenPlanet
Do a barrel roll!
Originally posted by 2027 View Post
I posted CG_Trace in the pastebin link. That was the whole point lol. And I did get CG_CanSeeFriendlyHead working in mw2

EDIT:
FX_GetClientVisibility is in CG_CanSeeFriendlyHead in MW2. You must have had the wrong FX_GetClientVisibility


lol, sorry I didnt notice that you posted the CG_Trace address in the pastebin Smile
//Easier way
CG_LocationalTrace(&trace, cg_t->refdef.viewOrigin, Headpos, cg_t->clientNumber, 0x2803001, false, 0); //You wont need a null vector3
btw I dubble-checked my FX_GetClientVisibility (0x15BB20) but couldnt find any errors. Is there any sub_15BB20 in your CG_CanSee function?
Last edited by TheGreenPlanet ; 09-10-2016 at 02:26 PM.
09-11-2016, 05:22 AM #9
gopro_2027
Vault dweller
Originally posted by TheGreenPlanet View Post
lol, sorry I didnt notice that you posted the CG_Trace address in the pastebin Smile
//Easier way
CG_LocationalTrace(&trace, cg_t->refdef.viewOrigin, Headpos, cg_t->clientNumber, 0x2803001, false, 0); //You wont need a null vector3
btw I dubble-checked my FX_GetClientVisibility (0x15BB20) but couldnt find any errors. Is there any sub_15BB20 in your CG_CanSee function?


Yea that is the same FX_GetClientVisibility as I have and it xrefs to CG_CanSeeFriendlyHead. It also xrefs to AimTarget_IsTargetVisible (which I haven't tested but I think it isn't the same so it won't work idk) and CG_ScanForCrosshairEntity
09-11-2016, 05:24 AM #10
gopro_2027
Vault dweller
Originally posted by TheGreenPlanet View Post
lol, sorry I didnt notice that you posted the CG_Trace address in the pastebin Smile
//Easier way
CG_LocationalTrace(&trace, cg_t->refdef.viewOrigin, Headpos, cg_t->clientNumber, 0x2803001, false, 0); //You wont need a null vector3
btw I dubble-checked my FX_GetClientVisibility (0x15BB20) but couldnt find any errors. Is there any sub_15BB20 in your CG_CanSee function?


Also how do I find refdef? I looked in the cod4 pdb to try to find a link and couldn't find anything to help.

Copyright © 2025, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo