Jump to content

Help with multiple arguments on MSHooking


Go to solution Solved by AnotherLurker,

33 posts in this topic

Recommended Posts

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Posted (edited)

You need to provide names for arguments, you can't leave them nameless and somehow expect the compiler to properly reference them.

I know

just your code (id)pathUser atPos

is wrong because you need to change pathUser to arg1

also the pic only have (id)atPos

Updated by ITz_kser
Posted

Both.

 

Heres my code:

%hook TradePortal
- (void) buyItem:(int)arg1 atTotalPrice:(int)arg2 count:(int)arg3 {
 if (GetPrefBool(@"key6")) {
arg2 = 0;
%orig (arg1, arg2, arg3);
}
return %orig;

%end
Posted (edited)

Both.

 

Heres my code:

%hook TradePortal
- (void) buyItem:(int)arg1 atTotalPrice:(int)arg2 count:(int)arg3 {
 if (GetPrefBool(@"key6")) {
arg2 = 0;
%orig (arg1, arg2, arg3);
}
return %orig;

%end

 

%hook TradePortal
- (void) buyItem:(int)arg1 atTotalPrice:(int)arg2 count:(int)arg3 {
    if (GetPrefBool(@"key6")) {
        %orig (arg1, 0, INT_MAX);
    }
    
    return %orig;
}

%end
Buys Infinite Items at 0 price. :drink: Updated by Dwayne Johnson
Posted

 

I'm going to test run it now.

 

%hook TradePortal
- (void) buyItem:(int)arg1 atTotalPrice:(int)arg2 count:(int)arg3 {
    if (GetPrefBool(@"key6")) {
        %orig (arg1, 0, INT_MAX);
    }
    
    return %orig;
}

%end
Buys Infinite Items at 0 price. :drink:

Lol no, my inventory cant fit them all xD.

Posted

You don't have to name it arg1... you can name it whatever you want.

idk about this but I see arg is better

 

Both.

Heres my code:

%hook TradePortal
- (void) buyItem:(int)arg1 atTotalPrice:(int)arg2 count:(int)arg3 {
 if (GetPrefBool(@"key6")) {
arg2 = 0;
%orig (arg1, arg2, arg3);
}
return %orig;

%end
it's work with you right ^_^

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