Page 1 of 1

automatic respawn w/ skipping model selection

Posted: Thu Jan 21, 2016 4:25 pm
by decompile
Hey how is it possible to skip the model selection in CS:S for all players?
and
For the automatic respawn
I used the event player_team and waited 3 seconds to respawn him automatic with m_iPlayerState 0 and m_lifeState 512 but it seems that you respawn sometimes while being in the model selection and when you choose the model you die instantly..

Posted: Thu Jan 21, 2016 4:57 pm
by iPlayer
I tried to hide 'class' VGUIMenu on player_team, but it seems like I can't do anything with the VGUIMenu of this name - not to show it, nor to hide it.

So here's another way

Syntax: Select all

from commands.client import ClientCommand


@ClientCommand('joinclass')
def cmd_on_joinclass(command, index):
return False


Note that this prevents players from being respawned by the game when they select the skin. So make sure you do respawn them.


Alternatively, you can respawn player 3 seconds later after 'joinclass' command been executed instead of doing it in player_team event.

Posted: Thu Jan 21, 2016 7:24 pm
by iPlayer
Working snippet using VGUIMenu hiding

Syntax: Select all

from commands.client import ClientCommand
from messages import VGUIMenu
from players.entity import Player


hidden_class_selection_ct = VGUIMenu('class_ct', show=False)
hidden_class_selection_t = VGUIMenu('class_ter', show=False)


@ClientCommand('jointeam')
def cmd_jointeam(command, index):
player = Player(index)

hidden_class_selection_ct.send(index)
hidden_class_selection_t.send(index)
player.client_command("joinclass 1;")

return True

Posted: Thu Jan 21, 2016 7:26 pm
by decompile
Thank you, awesome!