Mshook field inside field.

Sbenny.com is trusted by 1,331,304 happy users since 2014.
Register

ZEFF228

Lurker Lv0️⃣
void (*old_PlayerNetwork)(...);
void PlayerNetwork(void* instance) {
if (instance != NULL) {
void* WeaponSet = *(void* *)((uint64_t)instance + 0x68);
if (WeaponSet != NULL) {
if (button) {
*(float *)((uint64_t)WeaponSet + 0xOFFSET) = float_value;
}
}
}
return (*old_PlayerNetwork)(instance);
}


I have such code. I need a code that opens a script, inside which it opens 1 more, and only then edits the value.

I tried to make the code myself, following the example, but for some reason unknown to me, when the function was activated, the game crashed.
 

Sbenny

A crazy scientist
Staff member
Admin
SB Mod Squad ⭐
✔ Approved Releaser
Active User
Given nearly zero context, it's hard for us to help you, but generally speaking, the code you provided does already what you're looking for, as there are two nested if statements, meaning that the script will execute only if the two conditions above are true. You need, of course, to replace "float_value" with a proper value first, and same goes for "0xOFFSET".
 
Top