here's a small piece of source code, taken directly from Renegades, mission 1. It sets up 3 patrol routes, using waypoints. Study it, and LEARN!
EXPORT void SetPatrols()
{
LOCATION scoutRoute1[]=
{
LOCATION(120, 14),
LOCATION( 96, 6),
LOCATION(125, 36),
LOCATION(142, 41),
LOCATION(142, 15),
LOCATION( -1, -1)
};
LOCATION scoutRoute2[]= // scout right map
{
LOCATION(136, 47),
LOCATION( 91, 55),
LOCATION( 84, 23),
LOCATION(141, 14),
LOCATION( -1, -1)
};
LOCATION scoutRoute3[]= // scout enemy base
{
LOCATION(138, 24),
LOCATION( 90, 58),
LOCATION( 34, 60),
LOCATION( 49, 26),
LOCATION( 50, 8),
LOCATION( 85, 23),
LOCATION(133, 10),
LOCATION( -1, -1)
};
PatrolRoute route1,route2,route3;
FightGroup patrol1,patrol2,patrol3;
IUnit u;
patrol1=CreateFightGroup(Player[1]);
route1.waypoints=scoutRoute1;
patrol1.SetPatrolMode(route1);
patrol2=CreateFightGroup(Player[1]);
route2.waypoints=scoutRoute2;
patrol2.SetPatrolMode(route2);
patrol3=CreateFightGroup(Player[1]);
route3.waypoints=scoutRoute3;
patrol3.SetPatrolMode(route3);
TethysGame::CreateUnit(u,mapScout,LOCATION(158,2),1,mapNone,West);
patrol1.TakeUnit(u);
TethysGame::CreateUnit(u,mapScout,LOCATION(158,4),1,mapNone,SouthWest);
patrol2.TakeUnit(u);
TethysGame::CreateUnit(u,mapScout,LOCATION(158,6),1,mapNone,SouthWest);
patrol3.TakeUnit(u);
}