here's a code i wrote for rotating an entity, it passes the entity and the desired angles
Code:
void ai_rotate(ENTITY* ent, int degrees){
	
	while(ent.z < 40){
		if(int_game_state != game_state_playing){
			return;
		}
		
		ent.z = minv(ent.z + (time_step * 8), 40);
		wait(1);
	}
	
	int pan = ent.pan + degrees;
	while(ent.pan != pan){
		
		if(int_game_state != game_state_playing){
			return;
		}
		
		if(degrees < 0){
			
			ent.pan = maxv(ent.pan - (3 * time_step), pan);
		}else{
			
			ent.pan = minv(ent.pan + (3 * time_step), pan);
		}
		wait(1);
	}
	ent.pan = ang(ent.pan);
	
	while(ent.z > 0){
		if(int_game_state != game_state_playing){
			return;
		}
		
		ent.z = maxv(ent.z - (time_step * 8), 0);
		wait(1);
	}
}

I'm sure you'll be able to work it out from there, otherwise gimme a shout

the 2 other angles will just be proporionate to the percentage the 1st angle has rotated