Page 1 of 1

ccode void[solved]

Posted: Mon Oct 11, 2021 12:22 pm
by Frouk
I already know how to call function void, but idk how to call function with boolean

Re: C# Code void

Posted: Mon Oct 11, 2021 12:44 pm
by SunBeam
Seriously?.. Define a boolean value and assign tk it the boolean function.

bool myBool = MyBoolFunc()

bool MyBoolFunc()
{
...
return true
}

Re: C# Code void

Posted: Mon Oct 11, 2021 1:00 pm
by Frouk
Not like this
In c++ i can use
void(*Game_SetCopsEnabled)(bool AreCopsEnabled) = (void(*)(bool))0x6513E0;

Re: C# Code void

Posted: Mon Oct 11, 2021 3:22 pm
by Frouk
any1?

Re: C# Code void

Posted: Mon Oct 11, 2021 4:01 pm
by SunBeam
Man, you want to typedef a known pointer (address) to a name you want to give to a function. That's what I see there. Please explain better your quest next time.

Re: ccode void

Posted: Tue Oct 12, 2021 5:46 am
by Frouk
I mean c code void(Cheat Engines update with c-compiler)

Code: Select all

typedef int(__cdecl *fDisableDriftPhys)(void);

fDisableDriftPhys DisableDriftPhys = (fDisableDriftPhys)0x65C910;

DisableDriftPhys()
I can use this to call game function without any boolean or value types
All i want is to call game function with boolean

Code: Select all

CopToggleSwitch(true) //Enable Cops
CopToggleSwitch(false) //Disable Cops
But i don't know how to, i tried all my ideas, even searched in google but didn't find

Re: ccode void

Posted: Tue Oct 12, 2021 8:43 am
by Eric
it's called "parameters"

and you can just add them to the typedef parameters

if bool won't work use int and define true as 1 or 0xffffffff and false as 0

Re: ccode void

Posted: Tue Oct 12, 2021 10:42 am
by Frouk
Eric wrote:
Tue Oct 12, 2021 8:43 am
it's called "parameters"

and you can just add them to the typedef parameters

if bool won't work use int and define true as 1 or 0xffffffff and false as 0
Can you write down an example?(i can't rid of errors)

Re: ccode void

Posted: Tue Oct 12, 2021 10:55 am
by Frouk
nvm i get it(mistake that was in my script is one more parameter(int)(void) <-- this was an mistake)