Hi list, I have this code for creating a new keyboard command for throwing a 
grenade, the issue i'm having with it is when I include the commented code (to 
revert back the the previous player weapon) it only starts to change to the 
grenade then reverts back to the previous weapon, if i leave the code out then 
it does change the weapon and throw a grenade but obviously does not change 
back. Can anyone help with this? Cheers, Scott. void CC_ThrowGrenade( void ){ 
CBasePlayer *pPlayer = UTIL_GetCommandClient();  if ( pPlayer ) {  
CBaseCombatWeapon *pWeapon = pPlayer->GetActiveWeapon();  if ( pWeapon )  {   
// Tell the client to stop selecting weapons   engine->ClientCommand( 
UTIL_GetCommandClient()->edict(), "cancelselect" );   if ( 
pPlayer->Weapon_OwnsThisType( "weapon_frag" ) )   {    pPlayer->SelectItem( 
"weapon_frag" );    CBaseCombatWeapon *pFrag = pPlayer->GetActiveWeapon();    
pFrag->PrimaryAttack();    //pPlayer->SelectLastItem();   }  } }}static 
ConCommand throw_grenade( "throw_grenade", CC_ThrowGrenade );
_________________________________________________________________
Check out the new and improved services from Windows Live. Learn more! 
http://clk.atdmt.com/UKM/go/132630768/direct/01/
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to