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

[CSGO] Ingame InfoBox


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
heff
Junior Member
Join Date: Jan 2018
Old 09-18-2018 , 08:22   [CSGO] Ingame InfoBox
Reply With Quote #1

Hello Modders,

As most of you with CSGO Deathmatch experience, usually community servers offer a “Gun Menu”, accessable either at connect or by typing “guns” in the chat.

I’m wondering if its possible to make an infobox sort of the same way. For instance, maybe I want to be reminded to give info to my teammates - so an Info Box (like the Gun Menu) would be on my screen saying “Remember to say what you see and hear”.

Is this possible, and if so, how?
heff is offline
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
heff
Junior Member
Join Date: Jan 2018
Old 09-18-2018 , 11:09   Re: [CSGO] Ingame InfoBox
Reply With Quote #3

Thank you very much.

I appreciate the option to PM, I will most likely use it aswell! Have a very nice day, I'll let you know if it works.
heff is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 09-18-2018 , 11:47   Re: [CSGO] Ingame InfoBox
Reply With Quote #4

Quote:
Originally Posted by heff View Post
Thank you very much.

I appreciate the option to PM, I will most likely use it aswell! Have a very nice day, I'll let you know if it works.
You're welcome!
ThatKidWhoGames 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 10:19.


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