Пример #1
0
//-----------------------------------------------------------------------------
// Purpose: Handle commands sent from vgui panels on the client 
//-----------------------------------------------------------------------------
bool CBaseTFVehicle::ClientCommand( CBaseTFPlayer *pPlayer, const CCommand &args )
{
	ResetDeteriorationTime();

	if ( FStrEq( pCmd, "toggle_use" ) )
	{
		AttemptToBoardVehicle( pPlayer );
		return true;
	}

	return BaseClass::ClientCommand( pPlayer, args );
}
//-----------------------------------------------------------------------------
// Purpose: Handle commands sent from vgui panels on the client 
//-----------------------------------------------------------------------------
bool CBaseTFVehicle::ClientCommand( CBaseTFPlayer *pPlayer, const char *pCmd, ICommandArguments *pArg )
{
	ResetDeteriorationTime();

	if ( FStrEq( pCmd, "toggle_use" ) )
	{
		AttemptToBoardVehicle( pPlayer );
		return true;
	}

	return BaseClass::ClientCommand( pPlayer, pCmd, pArg );
}
void CWalkerMiniStrider::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
	// Sapper removal
	if ( RemoveEnemyAttachments( pActivator ) )
		return;

	CBaseTFPlayer *pPlayer = dynamic_cast<CBaseTFPlayer*>(pActivator);
	if ( !pPlayer || !InSameTeam( pPlayer ) )
		return;
	
	// Ok, put them in the driver role.
	AttemptToBoardVehicle( pPlayer );
}
Пример #4
0
//-----------------------------------------------------------------------------
// Purpose: Get into the vehicle
//-----------------------------------------------------------------------------
void CBaseTFVehicle::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
	BaseClass::Use( pActivator, pCaller, useType, value );

	if ( useType == USE_ON )
	{
		CBaseTFPlayer *pPlayer = dynamic_cast<CBaseTFPlayer*>(pActivator);
		if ( pPlayer && InSameTeam(pPlayer) )
		{
			// Check to see if we are really using nearby build points:
			if( !UseAttachedItem( pActivator, pCaller, useType, value ) )
			{
				// Attempt to board the vehicle:
				AttemptToBoardVehicle( pPlayer );
			}
		}
	}
}