View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-26-2015 , 17:24   Re: [cs:go] menu pop-up on roundstart and chat cmd.
Reply With Quote #3

Quote:
Originally Posted by AleCz14 View Post
I started working on a Menu using a menu generator, i dont know how to make the Menu to auto show-up on round_start and on chatcmd "!shop", maybe u can help me.
If the menu is always the same, you may want to move the Menu variable to a global variable and just display the menu in your function.

I really should add an option for that to the menu generator at some point.

As for displaying the menu on Round Start and Player Spawn, event hooks for those aren't difficult to do.

Having said that, lets make those changes

Spoiler


Note that I made a few other adjustments... notably, I changed the menu type as I've heard Valve menus don't work in CS:GO (it's missing the UI for it).

Quote:
Originally Posted by Exolent[jNr] View Post
Hooking chat commands like this:
Code:
public OnClientSayCommand_Post(client, const String:command[], const String:sArgs[]) {     if (StrEqual(sArgs, "!shop")) {         // Show menu to client     } }

And you can hook events as seen here:
https://wiki.alliedmods.net/Events_(...Mod_Scripting)

You might want to hook player spawn to show it whenever they spawn.
If you're registering commands starting with / or !, you really should use RegConsoleCmd.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline