Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding

Reply
 
Thread Tools Display Modes
Old 05-26-2008, 05:42 PM   #1
Aandnota
 
 
 
Guest
Posts: n/a
Forcing Team Menu

i'm really new at coding in source, so please bear with me.

i just want to write a script that forces the team menu to popup whenever a client goes into spec mode.

i'm not sure how to do this. i've checked the vgui_drawtree and seen that the "team" is a popup, not a panel, is this right? i've found vgui_togglepanel but it doesn't work, nor did i really think it would, since "team" is classed as a popup.

right?

like i said, i'm really new to this. it seems like this should be something simple. am i missing something that should be obvious? is this impossible?

thanks in advance.
 
Reply With Quote
Old 05-26-2008, 05:48 PM   #2
Trentelshark
 
Join Date: Mar 2008
Reputation: 0
Posts: 37
Try adding this call in hl2mp_player.cpp in CHL2MP_Player::ChangeTeam after the lines that read:

if ( iTeam == TEAM_SPECTATOR )
{
RemoveAllItems( true );
State_Transition( STATE_OBSERVER_MODE );
// try putting it here
}

this->ShowViewPortPanel( PANEL_TEAM, true, 0 );

ShowViewPortPanel works in hl2mp_client.cpp in FinalizePutInServer and the pointer there is of type CHL2MP_Player so that should have some effect.
Trentelshark is offline   Reply With Quote
Old 05-26-2008, 06:35 PM   #3
Marine
 
Join Date: Sep 2006
Reputation: 9
Posts: 2,691
Quote:
Originally Posted by Trentelshark View Post
Try adding this call in hl2mp_player.cpp in CHL2MP_Player::ChangeTeam after the lines that read:

if ( iTeam == TEAM_SPECTATOR )
{
RemoveAllItems( true );
State_Transition( STATE_OBSERVER_MODE );
// try putting it here
}

this->ShowViewPortPanel( PANEL_TEAM, true, 0 );

ShowViewPortPanel works in hl2mp_client.cpp in FinalizePutInServer and the pointer there is of type CHL2MP_Player so that should have some effect.

Not a good idea.

Make sure you've named all your panels correctly, (Case matters)
Marine is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -7. The time now is 02:21 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2012, All Rights Reserved.