I need players to display this menu when they connect:
PHP Code:
/*****************************/
//Pragma
#pragma semicolon 1
#pragma newdecls required
/*****************************/
//Defines
#define PLUGIN_NAME "Valve Menu"
#define PLUGIN_DESCRIPTION "Shows the information menu with the /info command."
#define PLUGIN_VERSION "1.0.0"
/*****************************/
//Includes
#include <sourcemod>
/*****************************/
//ConVars
/*****************************/
//Globals
Menu g_InfoMenu;
/*****************************/
//Plugin Info
public Plugin myinfo =
{
name = PLUGIN_NAME,
author = "Drixevel",
description = PLUGIN_DESCRIPTION,
version = PLUGIN_VERSION,
url = "https://drixevel.dev/"
};
public void OnPluginStart()
{
g_InfoMenu = new Menu(MenuHandler_Info);
g_InfoMenu.SetTitle("----------------------\nSkins (/valve)\n----------------------");
g_InfoMenu.AddItem("sm_ws", "Weapon Skins");
g_InfoMenu.AddItem("sm_knife", "Knives");
g_InfoMenu.AddItem("sm_gloves", "Gloves");
g_InfoMenu.AddItem("sm_sprays", "Sprays");
g_InfoMenu.AddItem("sm_musickit", "Musickits - Soon");
RegConsoleCmd("sm_valve", Command_Info, "Shows the information menu.");
}
public Action Command_Info(int client, int args)
{
if (client == 0)
return Plugin_Handled;
g_InfoMenu.Display(client, MENU_TIME_FOREVER);
return Plugin_Handled;
}
public int MenuHandler_Info(Menu menu, MenuAction action, int param1, int param2)
{
switch (action)
{
case MenuAction_Select:
{
char sCommand[32];
menu.GetItem(param2, sCommand, sizeof(sCommand));
FakeClientCommand(param1, sCommand);
}
}
}