Here:
Note: It's not tested yet but it should do the job
PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma newdecls required
public Plugin myinfo =
{
name = "VIPMenu",
author = "BraveFox",
description = "",
version = "1.0",
url = "forums.alliedmods.net",
};
public void OnPluginStart()
{
RegConsoleCmd("sm_vip", vipmenu);
}
public Action vipmenu(int client, int args)
{
if(!IsValidClient(client))
return Plugin_Handled;
Handle menu = CreateMenu(MenuHandelr);
SetMenuTitle(menu, "My first");
AddMenuItem(menu, "trails", "Trails");
AddMenuItem(menu, "hats", "Hats");
AddMenuItem(menu, "wskins", "Weapon Skins");
AddMenuItem(menu, "knife", "Knife Menu");
DisplayMenu(menu, client, 15);
return Plugin_Continue;
}
public int MenuHandelr(Menu menu, MenuAction action, int client, int itemNum)
{
if(action == MenuAction_End || !IsValidClient(client))
CloseHandle(menu);
if(action == MenuAction_Select)
{
switch(itemNum)
{
case 0:
{
FakeClientCommand(client, "say /trails");
}
case 1:
{
FakeClientCommand(client, "say /hats");
}
case 2:
{
FakeClientCommand(client, "say /ws");
}
case 3:
{
FakeClientCommand(client, "say /knife");
}
}
}
}
stock bool IsValidClient(int client, bool bAlive = false)
{
if(client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (bAlive == false || IsPlayerAlive(client)))
{
return true;
}
return false;
}
__________________