This is the AMP version of this page.
If you want to load the real page instead, click this text.

Help! I need help with the distinction between friend and foe.

Super丶Xuan

Solid & Active Platinian
How do I mount this method function to differentiate between the enemy and myself, I hope someone can help me, preferably by writing an example image for me to look at, thanks! My English is not very good, I'm sorry!
 

Attachments

  • 17571112717179.png
    67.2 KB · Views: 86
Looks like it uses enum which is the same as int to determine the team color.

I could be wrong but I'd hook it like this...

C++:
int (*General_get_Team)(void *instance);

Then use it in in a hook like so...

C++:
void (*old_Update)(void *instance);
void Update(void *instance) {
    if(instance!=NULL) {
        int Team = General_get_Team(instance);
        if(Team=1) { // Type whatever team color number here, I use 1 as an example. Look in TeamType for this.
            // Some code that you want to do here
        }
    }
    old_Update(instance);
}


Then this under hack thread...

C++:
General_get_Team = (int(*)(void*)) getAbsoluteAddress(targetLibName, 0xA70C54);
 
There's a method in that class called "IsEmemy" which is probably a bool with an int parameter to check the team color. It might be better to use that instead of "get_Team"
 
There's a method in that class called "IsEmemy" which is probably a bool with an int parameter to check the team color. It might be better to use that instead of "get_Team"
Thank you so much for taking the time to answer my question, I will go ahead and try to hook it up.
I have another question for you, how do I write the hook about this "Fixed" type method? I don't know what type it is!Maybe “Double”?
 

Attachments

  • 16820123203043.png
    82.9 KB · Views: 65