Page 1 of 1

[CSGO] Unable to send VGUIMenu

Posted: Tue Jun 14, 2016 8:55 pm
by Jake
Hello, I'm trying to send a simple VGUIMenu but nothing shows up and no errors are logged. Here's the snippet:

Syntax: Select all

from commands.typed import TypedSayCommand
from messages import VGUIMenu

@TypedSayCommand('page')
def cmd_page(cmdInfo) :
subkeys = {
'title': 'some title',
'type': '2',
'msg': 'http://google.com'
}
VGUIMenu(name='info', subkeys=subkeys, show=True).send(cmdInfo.index)

Re: [CSGO] Unable to send VGUIMenu

Posted: Tue Jun 14, 2016 9:04 pm
by Ayuto
In CS:GO you have to use a little workaround:
viewtopic.php?f=20&t=902

So, instead of using the URL directly, you have to use a little bit JavaScript to get it working.

Re: [CSGO] Unable to send VGUIMenu

Posted: Tue Jun 14, 2016 9:08 pm
by iPlayer
Works for me in CS:S. Although there's a glitch when it closes instantly, so you have to type "page" command two times. It doesn't happen if VGUIMenu is sent by popup, though, or by other matters.

Oh, and in CS:GO you won't get HTML MoTD to work that easy. You'll need to use a hack like this:

Syntax: Select all

<!doctype html>
<html>
<head>
<title>Redirect</title>
<script type="application/javascript">
var popup=window.open("https://google.com/", "MOTD", "scrollbars=yes");
</script>
</head>
<body>
</body>
</html>


Host this page on your personal web-server and open it in your VGUIMenu instead of http://google.com/.

P.S.: Ninja'd.

Re: [CSGO] Unable to send VGUIMenu

Posted: Tue Jun 14, 2016 9:40 pm
by Jake
Ah cool, that works. It's a little buggy though unfortunately. Is there something more reliable for displaying static text by chance?

Re: [CSGO] Unable to send VGUIMenu

Posted: Tue Jun 14, 2016 9:43 pm
by iPlayer
Try this

Syntax: Select all

from commands.typed import TypedSayCommand
from messages import VGUIMenu

@TypedSayCommand('page')
def cmd_page(cmd_info) :
subkeys = {
'title': 'some title',
'type': '0', # Note that it's not '2' anymore
'msg': "Some static text",
}
VGUIMenu(name='info', subkeys=subkeys, show=True).send(cmd_info.index)


I have no idea if CS:GO fails with HTML MoTDs only or with text MoTDs too.

I suspect Valve might have done that intentionally to prevent server owners from annoying players with HTML ads. Although those ads are really loud and annoying, disabling MoTDs at all is the option I hate so much. But what's other reasoning one can come up with? This functionality has been missing for too long to be a regular bug.

Re: [CSGO] Unable to send VGUIMenu

Posted: Wed Jun 15, 2016 11:35 pm
by Jake
No luck there, the menu doesn't show at all. I'll probably avoid this vgui panel entirely for CS:GO :(

Thanks for the support Ayuto & iPlayer