Something like this maybe?
PHP Code:
#include <sourcemod>
new Handle:g_hMenu = INVALID_HANDLE;
public OnPluginStart()
{
RegAdminCmd("sm_mix", OnMixCommand, ADMFLAG_ROOT, "Mix menu");
}
public OnMapStart()
{
g_hMenu = CreateMenu(MenuHandler);
SetMenuTitle(g_hMenu, "Mix Menu");
AddMenuItem(g_hMenu, "0", "Restart");
AddMenuItem(g_hMenu, "1", "Spectate All");
AddMenuItem(g_hMenu, "2", "Live");
AddMenuItem(g_hMenu, "3", "Reset Mix");
}
public OnMapEnd()
{
if (g_hMenu != INVALID_HANDLE)
{
CloseHandle(g_hMenu);
g_hMenu = INVALID_HANDLE;
}
}
public MenuHandler(Handle:menu, MenuAction:action, param1, param2)
{
if (action == MenuAction_Select && IsClientInGame(param1))
{
switch (param2)
{
case 0: //Restart
{
PrintToChat(param1, "Restart was selected");
}
case 1: //Spectate All
{
PrintToChat(param1, "Spectate All was selected");
}
case 2: //Live
{
PrintToChat(param1, "Live was selected");
}
case 3: //Reset Mix
{
PrintToChat(param1, "Reset Mix was selected");
}
}
}
}
public Action:OnMixCommand(client, args)
{
if (client == 0)
{
ReplyToCommand(client, "Cannot use command from RCON.");
return Plugin_Handled;
}
if (g_hMenu == INVALID_HANDLE)
{
PrintToConsole(client, "Unable to open menu!");
}
else
{
DisplayMenu(g_hMenu, client, MENU_TIME_FOREVER);
}
return Plugin_Handled;
}
__________________