menus in CSGO
Posted: 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?
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.
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))
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)