I think pev->weapons (check by user_has_weapon) is updated right after, so check bpammo in combination.
Also, when you are checking more than 1 weapon, prefer pev_weapons rather than user_has_weapon, but it's not a big deal if you prefer to stick with user_has_weapon, would be different if code would be called often as in PreThink for example.
PHP Code:
new weapons = pev(id, pev_weapons)
HasC4[id] = ( weapons & 1<<CSW_C4 )
HasHE[id] = ( weapons & 1<<CSW_HEGRENADE ) && cs_get_user_bpammo(id, CCSW_HEGRENADE)
HasSG[id] = ( weapons & 1<<CSW_SMOKEGRENADE ) && cs_get_user_bpammo(id, CCSW_SMOKEGRENADE)
__________________