Raised This Month: $12 Target: $400
 3% 

Need rebuild plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joez252
Member
Join Date: Apr 2019
Old 01-06-2020 , 13:46   Need rebuild plugin
Reply With Quote #1

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 clientint args)
{
    if (
client == 0)
        return 
Plugin_Handled;
    
    
g_InfoMenu.Display(clientMENU_TIME_FOREVER);
    return 
Plugin_Handled;
}

public 
int MenuHandler_Info(Menu menuMenuAction actionint param1int param2)
{
    switch (
action)
    {
        case 
MenuAction_Select:
        {
            
char sCommand[32];
            
menu.GetItem(param2sCommandsizeof(sCommand));
            
FakeClientCommand(param1sCommand);
        }
    }

joez252 is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 01-07-2020 , 17:53   Re: Need rebuild plugin
Reply With Quote #2

Add:

PHP Code:

public void OnClientPostAdminCheck(int client)
{
    
g_InfoMenu.Display(clientMENU_TIME_FOREVER); 

__________________
Ilusion9 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:43.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode