Help! How to exclude yourself from drawing ESP

libModz

Awesome Active Platinian
Jun 2, 2022
163
29
28
UK
I could be wrong but I'd imagine it would be something like this...

C++:
bool (*get_isLocalPlayer)(void *instance);


void (*old_ESP_Update)(void *instance);
void ESP_Update(void *instance) {
    if(instance!=NULL) {
        bool isLocal = get_isLocalPlayer(instance);
        if(ESP) {
            if(!isLocal) {
                // Your esp code here
            }
         }
    }
    old_ESP_Update(instance);
}



// Under hackthread...


get_isLocalPlayer = (bool(*)(void*)) getAbsoluteAddress(targetLibName, 0xOFFSET);
 

libModz

Awesome Active Platinian
Jun 2, 2022
163
29
28
UK
Try it like this...

C++:
bool (*get_isLocalPlayer)(void *instance);

void (*old_player_update)(void *player);
void new_player_update(void *player) {
    if(player != NULL) {
        bool isLocal = get_isLocalPlayer(player);
        if(!isLocal) {
            // Your ESP code
 

Tosilegit

Platinian
Feb 1, 2022
10
1
3
Perttilä
To add to what libModz suggested earlier, I think this hook should work for you:
C++:
bool (*get_isLocalPlayer)(void *instance) = (bool (*)(void *))getRealOffset(0x000000); //place the offset

void (*old_player_update)(void *player);
void new_player_update(void *player) {
    if(player != NULL) {
        bool isLocal = get_isLocalPlayer(player);
        if(!isLocal) {
            // Your ESP code
It uses the same getRealOffset function as your hooks. Also make sure that "player" in your update function is the correct instance for the "get_isLocalPlayer" or other bools you use for the check.
 

AlexZero

Platinian
Original poster
Jun 17, 2019
22
3
3
Poland
I did but I get a crash, I don't know what I'm doing wrong,this is my code ,do i something wrong :pepe021: ?

Objective-C:
bool (*get_isLocalPlayer)(void *instance);
void (*old_player_update)(void *player);
void new_player_update(void *player) {
    if(player != NULL) {
        bool isLocal = get_isLocalPlayer(player);
        if(!isLocal) {
            // Your code here
            [esp setNeedsDisplay];
            if(WorldToScreen(GetObjectLocation(player)).z == 0) {
                me->object = player;
                me->position = GetObjectLocation(me->object);
                me->fov = get_fieldOfView(get_main());
            }
            if(WorldToScreen(GetObjectLocation(player)).z != 0 && player != me->object) {
                playerr->object = player;
                playerr->position = GetObjectLocation(playerr->object);
                playerr->w2sposition = WorldToScreen(playerr->position);
            }
            playerr->object = player;
            playerr->position = GetObjectLocation(playerr->object);
            playerr->w2sposition = WorldToScreen(playerr->position);
            float EnemyHeight = 4200 / (playerr->w2sposition.z / 4) / (me->fov / 2);
            float EnemyWidth = 840 / (playerr->w2sposition.z / 4) / (me->fov / 4);
            float EnemyCoordX = playerr->w2sposition.x - EnemyWidth / 2;
            float EnemyCoordY = playerr->w2sposition.y - EnemyHeight;
            if ([switches isSwitchOn:NSSENCRYPT("Players Lines")]) {
                [esp addEnemyLine:(EnemyCoordX + EnemyWidth / 2) y:EnemyCoordY];
            }
            if ([switches isSwitchOn:NSSENCRYPT("Players Boxes")]) {
                [esp addEnemyBox:EnemyCoordX y:EnemyCoordY w:EnemyWidth h:EnemyHeight];
            }
            if ([switches isSwitchOn:NSSENCRYPT("Players Bounds")]) {
                [esp addEnemyBounds:EnemyCoordX y:EnemyCoordY w:EnemyWidth h:EnemyHeight];
            }
            if ([switches isSwitchOn:NSSENCRYPT("Players Compass")]) {
                [esp addEnemyCompass:(EnemyCoordX + EnemyWidth / 2) y:EnemyCoordY];
            }
            if ([switches isSwitchOn:NSSENCRYPT("Players Watermark")]) {
                [esp addEnemyWatermark:EnemyCoordX y:EnemyCoordY w:EnemyWidth h:EnemyHeight];
            }
            if ([switches isSwitchOn:NSSENCRYPT("Players Distance")]) {
                [esp addEnemyDistance:EnemyCoordX y:EnemyCoordY w:EnemyWidth h:EnemyHeight];
            }
            if ([switches isSwitchOn:NSSENCRYPT("Players Lines Center")]) {
                [esp addEnemyCenterLine:(EnemyCoordX + EnemyWidth / 2) y:EnemyCoordY];
            }
        }
    }
    old_player_update(player);
}
void setup() {
    playerr = new player_t();
    me = new me_t();

bool (*get_isLocalPlayer)(void *instance) = (bool (*)(void *))getRealOffset(0x2231668);
 

Tosilegit

Platinian
Feb 1, 2022
10
1
3
Perttilä
Delete this
C++:
bool (*get_isLocalPlayer)(void *instance);
from on top of the update function. It is not needed

And replace it with the hook
C++:
bool (*get_isLocalPlayer)(void *instance) = (bool (*)(void *))getRealOffset(0x2231668);
Right now the hook seems to be inside of some other setup function. Just move it on top of the update function as I tell you above.
 

AlexZero

Platinian
Original poster
Jun 17, 2019
22
3
3
Poland
I did as you wrote, but I get a crash in game after load match(probably the moment when esp wants to draw) and the offset is not lit up green, it seems to me that the bool should be there, but when I put it there I get this error
1712089086156.png
1712089149049.png
 

Tosilegit

Platinian
Feb 1, 2022
10
1
3
Perttilä
That error happens because the get_isLocalPlayer hook is under the update function and not over it. Presumably because you have it in the setup function.

So does the crash happen when you put the hook on top of the update function? If so, maybe try some other bool.
Right now the hook seems to be inside of some other setup function. Just move it on top of the update function as I tell you above.
This should work, but it's possible that it doesn't work like that on your project on iOS.
 

Francois284Modz

Awesome Active Platinian
Jun 10, 2018
187
2,438
193
26
france
What are you using for your player list ?
If is the esp manager that mean you used a update function . And inside that class does it have fields or a function that is mine or islocal
 

AlexZero

Platinian
Original poster
Jun 17, 2019
22
3
3
Poland
What are you using for your player list ?
If is the esp manager that mean you used a update function . And inside that class does it have fields or a function that is mine or islocal
well, there is no ismine islocal or something similar in this class , I use LateUpdate to draw esp.
 

AlexZero

Platinian
Original poster
Jun 17, 2019
22
3
3
Poland
What are you using for your player list ?
If is the esp manager that mean you used a update function . And inside that class does it have fields or a function that is mine or islocal


I found another class that also draws esp on players (there is a small problem but it draws fine) and there is a field public bool AsMe; // 0x189. Will this also work?
1712158766192.png
 

Francois284Modz

Awesome Active Platinian
Jun 10, 2018
187
2,438
193
26
france
I found another class that also draws esp on players (there is a small problem but it draws fine) and there is a field public bool AsMe; // 0x189. Will this also work? View attachment 620556
Try that with

bool Asme(void *player) {
return *(bool *) ((uintptr_t) player + 0x189);
}

Before your esp draw function and

If(!Asme(player))
// Draw esp line