I wasn't trying to do something like that. I have functions that return menu handles:
Code:
public Handle:Menu_Main...
public Handle:Menu_Options...
public Handle:Menu_Skills...
and I wanted to make a simple function like "ShowMenu(client, menu_name, time)" to make this simpler:
PHP Code:
stock ShowMenu(client, const String:menu_name[], time=MENU_TIME_FOREVER)
{
//Format the function name
new String:func_name[32];
Format(func_name, 32, "Menu_%s", menu_name)
//Get the function id
new Function:func=GetFunctionByName(INVALID_HANDLE, function_name);
//Return if the function is invalid
if(func==INVALID_FUNCTION)
return;
//Start the call
Call_StartFunction(INVALID_HANDLE, func);
//Push variable 'client'
Call_PushCell(client);
//Get the menu handle
new Handle:menu= INVALID_HANDLE;
Call_Finish(menu);
//Return if the menu handle is invalid
if(menu==INVALID_HANDLE)
return;
//Display the menu
DisplayMenu(menu, client, time);
}
I don't know it works or not. I have to do more coding before I test the plugin.
__________________