You can script something up most likely, depending on how you want it to work. Attached is a first aid script I used in Last Tango in Bagango (I got it from SharkAttack, and he couldn't remember where he got it).
In its first incarnation, when a unit was hit I would addAction to the unit to the call the script. Player as leader could then order any unit to perform the heal action (including the hit unit). When an action is attached to a unit (or any object), the unit ordered to perform the action moves to the location of the object the Action is attached to. That is good for moving a "medic unit" to a wounded unit (who has the action attached). Problem is that Actions are available to ALL units, so ALL units become potential medics using this technique.
I changed it to be activated via radio instead, so when a unit was hit, the radio heal action would be named specific to the man hit (easier for player to order man to heal himself). For my purposes, this was so any unit could heal themselves (not a medic).
You could script a unit to serve as medic for other units by doing the following:1. Add Hit Eventhandlers on those units medic would serve. The EH would add the hit unit to a global WoundedUnit unit array.
2. Write a MEDIC script with this logic:
[b]Input variables:[/b]
- medicUnit (pass in unit you want to be medic)
vTrys = 0
While Alive medicUnit
LOOP
IF unit found in WoundedUnit Array THEN
medicUnit move to position of wounded unit.
WHILE Distance between medic Unit and wounded Unit > 2 AND vTrys < X (how long should medic
attempt to reach the wounded unit?)
LOOP
vTrys = vTrys + 1;
sleep 4;
END LOOP
IF medicUnit within 1 meter of woundedUnit then
medicUnit say "I gotcha buddy, u gonna be alright"
play healing animations
sleep long enough for animations
woundedUnit say "u rock doc, thanks",
ELSE
medicUnit says "I can't get to him, sorry", and gives up trying
END IF
remove wounded unit from woundedUnit array
END IF
sleep 5;
END LOOP
To get the unit to the wounded unit, you might use Hoz's DoFollowUnit script, and end that script when medic close enough to wounded man. This would be helpful if he is going to heal a wounded that is upright and mobile (you wouldn't have to re-invent follow logic). Maybe the doFollowUnit script should be run on the wounded unit also, so they both move toward each other.
Lots o' options. This would be fun to write, and I'm tempted, but I just got ARMA2 so...I have no time for anything else. You understand.
Good luck sir.