[CSGO] Unable to send VGUIMenu

Please post any questions about developing your plugin here. Please use the search function before posting!
Jake
Junior Member
Posts: 19
Joined: Sun Oct 04, 2015 7:54 pm

[CSGO] Unable to send VGUIMenu

Postby Jake » Tue Jun 14, 2016 8:55 pm

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)
Last edited by Ayuto on Tue Jun 14, 2016 9:04 pm, edited 1 time in total.
Reason: code -> python
User avatar
Ayuto
Project Leader
Posts: 1824
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: [CSGO] Unable to send VGUIMenu

Postby Ayuto » Tue Jun 14, 2016 9:04 pm

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.
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: [CSGO] Unable to send VGUIMenu

Postby iPlayer » Tue Jun 14, 2016 9:08 pm

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.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
Jake
Junior Member
Posts: 19
Joined: Sun Oct 04, 2015 7:54 pm

Re: [CSGO] Unable to send VGUIMenu

Postby Jake » Tue Jun 14, 2016 9:40 pm

Ah cool, that works. It's a little buggy though unfortunately. Is there something more reliable for displaying static text by chance?
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: [CSGO] Unable to send VGUIMenu

Postby iPlayer » Tue Jun 14, 2016 9:43 pm

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.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
Jake
Junior Member
Posts: 19
Joined: Sun Oct 04, 2015 7:54 pm

Re: [CSGO] Unable to send VGUIMenu

Postby Jake » Wed Jun 15, 2016 11:35 pm

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

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 1 guest