Blockland Forums
Home
Help
Login
Register
Blockland Forums
»
Blockland Forums
»
Modification Help
»
Is there a way to find out if a certain function exists? [Solved]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Is there a way to find out if a certain function exists? [Solved] (Read 802 times)
Advanced Bot
January 03, 2014, 06:48:28 PM
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
»
Ad Bot
Advertisement
Zeblote
January 03, 2014, 06:51:56 PM
isfunction(player, iscake)
Axo-Tak
January 04, 2014, 02:37:54 AM
Quote from: Zeblote on January 03, 2014, 06:51:56 PM
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.
$trinick
January 04, 2014, 02:41:26 AM
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.
Port
January 04, 2014, 03:51:13 AM
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
Advanced Bot
January 09, 2014, 06:42:22 PM
Thanks guys.
Print
Pages: [
1
]
« previous
next »
Blockland Forums
»
Blockland Forums
»
Modification Help
»
Is there a way to find out if a certain function exists? [Solved]