how to script something like this ?

i want to do something like if this function is executed , bla bla bla , like this

if (function()){


}

if the function is executed do what inside in this if, i know its wrong to use that way , but how to do it correctly ???

bool Func()
{
    // Condition here
    return true;
}

void OtherFunc()
{
    if (Func())
    {
        // bla bla
    }
}

Something like that?

This is exactly the right way to do it, as long as the return type of your function is a bool.