View Single Post
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 09-18-2018 , 08:44   Re: [CSGO] Ingame InfoBox
Reply With Quote #2

Untested but should work. By my understanding this is what you wanted.
PHP Code:
#include <sourcemod>

#define MENU_TITLE "Menu Title"
#define MENU_ITEM "Remember to say what you see and hear"

public void OnPluginStart()
{
    
RegConsoleCmd("sm_test"Command_Callback);
}

public 
Action Command_Callback(int clientint args)
{
    
Menu menu = new Menu(Menu_Handler);
    
menu.SetTitle(MENU_TITLE);
    
menu.AddItem(""MENU_ITEMITEMDRAW_DISABLED);
    
menu.Display(clientMENU_TIME_FOREVER);

    return 
Plugin_Handled;
}

public 
int Menu_Handler(Menu menuMenuAction actionint param1int param2)
{
    if (
action == MenuAction_End)
        
delete menu;

    return 
0;

If you want to change the menu title or item name, change the phrase in the quotes for the defines MENU_TITLE and MENU_ITEM. Furthermore, if you want to change the command that makes the menu display, change the sm_test to sm_whatyouwant.

EDIT: If you would like any other features added to it such as it being automatically displayed, PM me.

Last edited by ThatKidWhoGames; 09-18-2018 at 08:52.
ThatKidWhoGames is offline