Hmm Try
bool damageonehit = false;
int (*old_damage)(void*);
int damage(void *dmg) {
if(dmg != NULL)
{
if(damageonehit)
{
return 9999999;
}
else
{
return 10;//I standards value
}
return old_damage(dmg);
}
You're using a toggle (on/off switch) therefore your case should be like this...
case 10:
damageonehit = boolean;
break;
No, he's right. It'sYou are wrong, Toggle is the type (CheckBox) false/true, so he writes it correctly : damageonehit = !damageonehit;
if it was "Button" then
damageonhit = bool - is already used;
I don't understand how bool = !bool can work as a button?No, he's right. It's
case 10:
damageonehit = boolean;
break;
for toggle.
Also works for "ButtonOnOff" but not for "Button".
damageonehit = !damageonehit This works for Button
When the button is pressed, code inside the case gets run.I don't understand how bool = !bool can work as a button?
Yeah that's how it would go ideally. I ran into the same problem when I wanted a bool which is true only when the button is pressed.because always if you want to make a switch, then you use bool = !bool, and if just a one-time call then bool = value;
Review Java Source, maybe the "{" is crooked somewhere or the switch is not specified correctly, because in your .cpp everything is fineWhen the button is pressed, code inside the case gets run.
This is just how the mod menu works.
Yeah that's how it would go ideally. I ran into the same problem when I wanted a bool which is true only when the button is pressed.
It's dumb that value = boolean doesn't work in buttons, only in toggles. But that's just how it is :/
bool damageonehit = false;
int (*old_damage)(void *instance);
int damage(void *instance) {
if(instance != NULL) {
if (damageonehit) {
return 9999999;
} else {
return old_damage(instance);
}
}
return old_damage(instance);
}
MSHookFunction((void *)getAbsoluteAddress("libil2cpp.so", 0x17C52E8), (void *) damage, (void **) &old_damage);
switch (featNum) {
case 10:
damageonehit = !damageonehit;
break;
}
We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share necessary information with our advertising and analytics partners to optimize your experience on our site.
Learn more about cookies
We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share necessary information with our advertising and analytics partners to optimize your experience on our site.
Learn more about cookies