Hello, I would like to know if I can store function in variable to then call directly from it, something like the following
Code:
new g_iFunction;
MyFunction(this)
{
// Do Something...
}
MyFunction2(this)
{
new Players[MAX_PLAYERS], iPlayerCount;
g_iFunction = MyFunction;
g_iFunction(Players[random(iPlayerCount)]);
}
I need this because I'm working with a large number of functions, so would be more easy to store the function and call it directly instead of use "switch" and/or "if/else if".
__________________