Code:
if ( g_pBaseClient->m_iWeaponID != g_pBaseClient->m_iLastWeaponID
	|| g_pBaseClient->m_iWeaponState != g_pBaseClient->m_iLastWeaponState )
{
	if ( *( PDWORD )( ( DWORD )pBaseCombatWeapon + 0x730 ) > 0x400000 )
	{
		__asm
		{
			MOV ESI, pBaseCombatWeapon
			ADD ESI, 0x730
			MOV EAX, DWORD PTR DS:[ESI]
			MOV EDX, DWORD PTR DS:[EAX+0x1C]
			MOV ECX, ESI
			CALL EDX
			MOV iDistance, EAX
		}

		g_pWeaponData->m_fRange = iDistance;
	}
}
Automatically grabs the m_fRange variable which controls how far the trace goes out. Changes when you change your weaponstate and so forth.