When I'm in a tank and manning the gun on top, I'm often confused as to what I should be doing when an enemy jet or tank starts getting to close to my position. I often open fire on them and try to inflict as much damage as possible. However, as far as I can tell, they're not doing anything at all. Am I mistaken, and can I actually hurt jets and tanks using tank bullets(not shells)? Or should I be focusing on checking for nearby engies or other soldiers?
The bullets from a tank's secondary position will inflict damage on most vehicles and all infantry.
Damage to aerial vehicles is fair, it's definitely worth shooting them to at least annoy them, and possibly disable them if they stick around long enough.
Damage to enemy armour is non-existant, and you're better off looking for enemy engineers repairing the tank, or scanning around for any sneaky engineers/supports who are looking for an easy kill on a distracted tank.
bullets from machine guns do not affect tanks or APCs. They DO affect aircraft if the aircraft are close enough. They are most effective against scout helicopters, far less effective against attack helicopters, and if you can hit a jet, they are somewhat effective, but really not worth shooting because the jets get out of the kill zone so quickly.
As others have said, you are best off shooting at soldiers on foot or in jeeps so you don't get C4'd or blown up by RPG.
One thing also to remember is that if you get a lucky shot through the canopy of ANY aircraft, you can also get a kill. I have seen snipers do that on rare occasion, and have been killed that way in a helicopter. You will also find scumbag teammates occasionally teamkill you with a rifle when you're in an airplane or chopper just before takeoff: They scumbag teamkiller will shoot you through the canopy of the jet or glass of the helo. That is also the way some snipers abuse spawns: They camp so they can see the planes or helo spawns and shoot the pilots as soon as they spawn in the aircraft. That is not possible with a tank, though. Bullets do nothing to armor. And as another person said, remember that the gun on an attack helicopter is an armor-piercing cannon; the gun on the scout helo is just a machine gun, but even so, it will destroy a tank after about 6 full-magazine unloads on the tank. Any tank stupid enough to just sit there while you shoot it up deserves to get destroyed. But more likely you will as you move low-level within range of other tanks, SAMs, and even ground soldiers shooting into your helo.