menus in CSGO

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
PhantomDancer
Member
Posts: 42
Joined: Wed Mar 15, 2017 10:39 am
Location: The Great Arctic Hemispheres

menus in CSGO

Postby PhantomDancer » Fri Jun 30, 2017 12:32 pm

is there a wiki or any info on what menus work in csgo? are there any selection menus besides the radiomenu?
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: menus in CSGO

Postby Ayuto » Fri Jun 30, 2017 3:03 pm

No, there isn't, but SP implements only two menu types: radio and esc (escape). So, you can quickly test it.

Beside those two you can also create menus using a MOTD. iPlayer created a cool library for that.

If you want to ask for user input you can also try out messages.dialog. I don't know if those classes are working in csgo.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: menus in CSGO

Postby satoon101 » Fri Jun 30, 2017 3:11 pm

Ayuto wrote:If you want to ask for user input you can also try out messages.dialog. I don't know if those classes are working in csgo.

The last I checked, none of the Dialog (ESC) messages work in CS:GO. They have been adding support for other messages, like HudMsg, but I don't think any of the ESC messages have been included in that.
Image
User avatar
PhantomDancer
Member
Posts: 42
Joined: Wed Mar 15, 2017 10:39 am
Location: The Great Arctic Hemispheres

Re: menus in CSGO

Postby PhantomDancer » Fri Jun 30, 2017 3:50 pm

motd would be my last resort, although i too was wondering about a usermsg utilization. i know there is a votemenu in csgo but id have to refresh my knowledge on it.. btw did this thread go anywhere yet? https://github.com/Source-Python-Dev-Te ... issues/180
User avatar
PhantomDancer
Member
Posts: 42
Joined: Wed Mar 15, 2017 10:39 am
Location: The Great Arctic Hemispheres

Re: menus in CSGO

Postby PhantomDancer » Fri Jun 30, 2017 4:06 pm

shouldnt something be possible to create a string customized vote menu as usermsg and receive a YES/NO reply back from the client?

ill just create a virtual function to test this right now and see if it'll work or not. i think there are some more interesting functions in the csgo branch for sp https://wiki.alliedmods.net/Counter-Str ... erMessages
User avatar
PhantomDancer
Member
Posts: 42
Joined: Wed Mar 15, 2017 10:39 am
Location: The Great Arctic Hemispheres

Re: menus in CSGO

Postby PhantomDancer » Fri Jun 30, 2017 4:32 pm

Syntax: Select all

from messages.base import UserMessageCreator
class VoteStart(UserMessageCreator):
"""Create a VoteStart."""

message_name = 'VoteStart'
translatable_fields = ['disp_str', 'details_str', 'other_team_str']

def __init__(
self, team=0, ent_idx=0,vote_type=0, disp_str='', details_str='', other_team_str='', is_yes_no_vote=True):
"""Initialize the VoteStart instance."""
super().__init__(
team=team, ent_idx=ent_idx, vote_type=vote_type,disp_str=disp_str, details_str=details_str, other_team_str=other_team_str, is_yes_no_vote=is_yes_no_vote)

def protobuf(self, buffer, kwargs):
"""Send the VoteStart with protobuf."""
# buffer.set_string('msg_name', ' \x01' + kwargs.message)
buffer.set_int32('team', kwargs.team)
buffer.set_int32('ent_idx', kwargs.ent_idx)
buffer.set_int32('vote_type', kwargs.vote_type)
buffer.set_string('disp_str', kwargs.disp_str)
buffer.set_string('details_str', kwargs.details_str)
buffer.set_string('other_team_str', kwargs.other_team_str)
buffer.set_bool('is_yes_no_vote', kwargs.is_yes_no_vote)

def bitbuf(self, buffer, kwargs):
"""Send the VoteStart with bitbuf."""
buffer.write_byte(kwargs.team)
buffer.write_byte(kwargs.ent_idx)
buffer.write_byte(kwargs.vote_type)
buffer.write_string(kwargs.disp_str)
buffer.write_string(kwargs.details_str)
buffer.write_string(kwargs.other_team_str)
buffer.write_byte(kwargs.is_yes_no_vote)

import random
for i in range(1,1000):
VoteStart(random.randint(0,64),random.randint(0,64),random.randint(0,64))


this is my testcode, but it no work :(
User avatar
PhantomDancer
Member
Posts: 42
Joined: Wed Mar 15, 2017 10:39 am
Location: The Great Arctic Hemispheres

Re: menus in CSGO

Postby PhantomDancer » Fri Jun 30, 2017 4:41 pm

ah too bad i cant edit/correct my own post
User avatar
PhantomDancer
Member
Posts: 42
Joined: Wed Mar 15, 2017 10:39 am
Location: The Great Arctic Hemispheres

Re: menus in CSGO

Postby PhantomDancer » Fri Jun 30, 2017 4:43 pm

it works this way :

Syntax: Select all

from messages.base import UserMessageCreator
class VoteStart(UserMessageCreator):
"""Create a VoteStart."""

message_name = 'VoteStart'
translatable_fields = ['disp_str', 'details_str', 'other_team_str']

def __init__(
self, team=0, ent_idx=0,vote_type=0, disp_str='', details_str='', other_team_str='', is_yes_no_vote=True):
"""Initialize the VoteStart instance."""
super().__init__(
team=team, ent_idx=ent_idx, vote_type=vote_type,disp_str=disp_str, details_str=details_str, other_team_str=other_team_str, is_yes_no_vote=is_yes_no_vote)

def protobuf(self, buffer, kwargs):
# print("PROTO",buffer)
"""Send the VoteStart with protobuf."""
buffer.set_int32('team', kwargs.team)
buffer.set_int32('ent_idx', kwargs.ent_idx)
buffer.set_int32('vote_type', kwargs.vote_type)
buffer.set_string('disp_str', '\x01' +kwargs.disp_str)
buffer.set_string('details_str', '\x01' +kwargs.details_str)
buffer.set_string('other_team_str', '\x01' +kwargs.other_team_str)
buffer.set_bool('is_yes_no_vote', kwargs.is_yes_no_vote)

def bitbuf(self, buffer, kwargs):
# print("bitbuf",bitbuf)
"""Send the VoteStart with bitbuf."""
buffer.write_byte(kwargs.team)
buffer.write_byte(kwargs.ent_idx)
buffer.write_byte(kwargs.vote_type)
buffer.write_string( '\x01' +kwargs.disp_str)
buffer.write_string( '\x01' +kwargs.details_str)
buffer.write_string( '\x01' +kwargs.other_team_str)
buffer.write_byte(kwargs.is_yes_no_vote)
User avatar
PhantomDancer
Member
Posts: 42
Joined: Wed Mar 15, 2017 10:39 am
Location: The Great Arctic Hemispheres

Re: menus in CSGO

Postby PhantomDancer » Fri Jun 30, 2017 9:31 pm

i somehow cant edit or delete any of my posts. so i cant really correct anything without messing up the whole thread. right now i kinda wanna create a wiki for the whole csgo usermessages.

this should be the sp file: https://github.com/Source-Python-Dev-Te ... es/base.py

i would probably go ahead and add the missing usermessages to my local base.py file then.... but is there any official files on how to build the protobuf layout or would i have to dissamble the server files in ida? or what? thanks
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: menus in CSGO

Postby Ayuto » Sat Jul 01, 2017 8:00 am

The following zip file contains two *.proto files. Those contain the structure of the user messages and net messages:
http://media.steampowered.com/apps/csgo ... ssages.zip

This is only the initial version. Several new user messages have been added since then. Those need to be ripped out from the game's binary files.

If you want to create a wiki, you might want to start with the already implemented user messages.
http://wiki.sourcepython.com/contributi ... o-the-wiki
User avatar
PhantomDancer
Member
Posts: 42
Joined: Wed Mar 15, 2017 10:39 am
Location: The Great Arctic Hemispheres

Re: menus in CSGO

Postby PhantomDancer » Sat Jul 01, 2017 10:46 am

which binaries do i have to look into for usermsgs? your second link only leads to the general wiki :/
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: menus in CSGO

Postby Ayuto » Sat Jul 01, 2017 11:31 am

The server and engine binary would be a good place to start. I posted the second link, because you said you want to create a wiki.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 36 guests