Jump to content

iGMenu isSwitchWithIdentifierActive problems


Go to solution Solved by Ted2,

2 posts in this topic

Recommended Posts

Posted (edited)

Hi..

 

So I again (actually still) have issues with isSwitchWithIdentifierActive option in iGMenu.

 

This is the code I used:

	void (*add_Money)(void *cheats) = (void (*)(void *))getRealOffset(0xOffset);

	//original value or smth lul
	void(*old_Update)(void *cheats) = nil;
	bool isFeatureActive = false; 

	// make function of LateUpdate offset
	void Update(void *cheats) {
		if(isFeatureActive == false){
		old_Update(cheats);
	} else {
		add_Money(cheats);
	}
}

//under void startAuthentication() {

		MSHookFunction((void*)getRealOffset(0xOffset),(void*)Update,(void**)&old_Update); //Class: SomeClass -> Func: LateUpdate
		isFeatureActive = [menu isSwitchWithIdentifierActive:@"Switch1"]; 

    [menu addSwitchWithIdentifier:@"Switch1"
                            title:@"Add Money"
                      description:@"Enable me for something awesome!"];	

//under listener changes:

	isFeatureActive = [menu isSwitchWithIdentifierActive:@"Switch1"]; 
  
  

 

This does not work at all, however if I use this code, it does work perfectly fine.

 

	void Update(void *cheats) {
		if(1 < 2){
		add_Money(cheats);
	}	
	old_Update(cheats);
}

 

Any idea what might issue the first code? :/

Updated by Ted2
  • Solution
Posted

Fixed code:

	void Update(void *cheats) {

		if(![menu isSwitchWithIdentifierActive: @"Money"]) {
			old_Update(cheats);
		} else {
			add_Money(cheats);
		}
	}

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines