you would use menuselect under the ClientCommand function.
if ( FStrEq( pcmd, "menuselect" ) )
{
if ( CMD_ARGC() < 2 )
return TRUE;
int slot = atoi( CMD_ARGV(1) );
switch (pPlayer->vgui_Menu)
{
case MENU_CLASS:
default:
switch (slot)
{
case 1://Selected menu 1
break;
case 2://Selected menu 2
break;
case 3: //Selected menu 3
break;
case 4: //Selected menu 4
if ( pPlayer->pev->fov != 0 )
{
pPlayer->pev->fov = pPlayer->m_iFOV = 0; // 0 means reset to default
fov
}
else if ( pPlayer->pev->fov != 20 )
{
pPlayer->pev->fov = pPlayer->m_iFOV = 20;
}
break;
}
}
----- Original Message -----
From: "Michael Transue" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 18, 2002 12:00 AM
Subject: [hlcoders] Throwing back values from client...
Say I have this to send a VGUIMenu to the client:
pPlayer->ShowVGUIMenu(MENU_CLASS);
The menu works fine. My question is: When the client chooses from the menu,
how do I extract the value (by the button clicked) that the client chose -
and assign that choice to a variable server-side?
(int playerclass == ???)
_________________________________________________________________
Join the world's largest e-mail service with MSN Hotmail.
http://www.hotmail.com
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders