Each operator-vehicle pair is an adversary, who is able to produce replay attacks by maliciously and consecutively repeating the control commands for a period of time. The information operators know about their opponents is limited and restricted to the maximum number, say τmax, of consecutive attacks each adversary is able to launch. We focus on the design of distributed algorithms, which ensures mission completion in the presence of replay attacks. To achieve this goal, we come up with a novel distributed formation control algorithm that is based on receding-horizon control and leverages the idea of motion toward target points. We show that the input and state constraints are always enforced, and the desired formation can be asymptotically achieved provided that the union of communication graphs between operators satisfies certain connectivity assumptions. Under the same set of conditions, our proposed algorithm shows an analogous resilience to DoS attacks.