In CG stores the local player number.
Use that to find the ClientInfo structure for the given player. In that ClientInfo struct stores the local team number.
So a check would be like:
for(int i=0; i<18; i++)
if(ClientInfo[CG->ClientNumber]->Team == ClientInfo[i]->Team) continue; //This means the loop will start over if they are on the same team. Use != for only teammember check
//Do whatever you want to the enemy here. If you used != it's for the team members.