Achieving resilience remains a significant challenge for Unmanned Aerial Vehicle (UAV) communications in 5G and 6G networks. Although UAVs benefit from superior positioning capabilities, rate optimization techniques, and extensive line-of-sight (LoS) range, these advantages alone cannot guarantee high reliability across diverse UAV use cases. This limitation becomes particularly evident in urban environments, where UAVs face vulnerability to jamming attacks and where LoS connectivity is frequently compromised by buildings and other physical obstructions. This paper introduces DET-FAIR- WINGS ( Detection-Enhanced Transformer Framework for AI-Resilient Wireless Networks in Ground UAV Systems), a novel solution designed to enhance reliability in UAV communications under attacks. Our system leverages multi-agent reinforcement learning (MARL) and transformer-based detection algorithms to identify attack patterns within the network and subsequently select the most appropriate mechanisms to strengthen reliability in authenticated UAV-Base Station links. The DET-FAIR-WINGS approach integrates both discrete and continuous parameters. Discrete parameters include retransmission attempts, bandwidth partitioning, and notching mechanisms, while continuous parameters encompass beam angles and elevations from both the Base Station (BS) and user devices. The detection part integrates a transformer in the agents to speed up training. Our findings demonstrate that replacing fixed retransmission counts with AI-integrated flexible approaches in 5G networks significantly reduces latency by optimizing decision-making processes within 5G layers.