Hi,

in cod2 iwds you can find an astar.gsc file, its a pathfinding algorithm. Use it for search the path between the bots and players. Write a function what searches the shortest path and get the closest player. The bots have to move along on this path. If the bot is close enough to the target, hit him. That's all.