automatic respawn w/ skipping model selection

Please post any questions about developing your plugin here. Please use the search function before posting!
decompile
Senior Member
Posts: 416
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

automatic respawn w/ skipping model selection

Postby decompile » Thu Jan 21, 2016 4:25 pm

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

Postby iPlayer » Thu Jan 21, 2016 4:57 pm

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

Postby iPlayer » Thu Jan 21, 2016 7:24 pm

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
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
decompile
Senior Member
Posts: 416
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Postby decompile » Thu Jan 21, 2016 7:26 pm

Thank you, awesome!

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 28 guests