Author Topic: Is there a way to find out if a certain function exists? [Solved]  (Read 802 times)

Is there a way to find out if a certain function exists, like on an object?

isFunction(findclientbyname("Viso").player.isCake);

Does not work well.
« Last Edit: January 09, 2014, 06:42:36 PM by Advanced Bot »

isfunction(player, iscake)

isfunction(player, iscake)

The first argument is the object's class name.

To find an object's class name, call the method getClassName(); on the object.

If the function is a global function (doesn't have a class [like mFloor, echo, etc]) omit the classname.

isFunction("mFloor") == true

This is a note for anyone else that might find this thread, not the OP who has already demonstrated knowledge of how this function works.

Checking if function x exists:

isFunction("x") => true/false

Checking if method x on object y exists:

(
    isFunction(y.class, "x") ||
    isFunction(y.superClass, "x") ||
    isFunction(y.getName(), "x") ||
    isFunction(y.getClassName(), "x")
) => true/false