AI REVIVE/HEAL SP/MP   Last update 26th/11/2018   Hi all, Here is a script to allow AIs reviving and healing bros, according to parameters. This works in SP or MP. Compatible so far with AI RESPAWN script (see tag)
Don't override the respawn system (MP) Incapacitation: This script relies on incapacitated status for players or AIs. This status is created when not existing (SP, or MP Ais) to allow revive scenario.   parameters:   REACT  /  HEAL DELAY  /   AI CAN REVIVE   /  KIT NEEDED  /  NEED MEDIC / AI CAN HEAL EXTRA GRP  / BROS / WHITE FLAG ON MEDIC IN ACTION   Parameters can be added to description.ext, class Params, just add what you want in classes: "react" "bleedOut" "noReviveForAI" "AiKit" "AiMedic" "bros" "whiteflag". So you can choose them while in lobby. Anyway, if you pass parameters calling the function, these params will override the lobby ones (except for bros class, see below).  
                 Code must run on all PCs. So, init.sqf, (trigger, non-repeatable, condition true)...

    Totally reworked (see below). EDITED: version with added parameter (see spoiler above. Should work fine in MP. Feedback welcome.
Added possibility for multiple call lines.   Last version with waypoints instead of domove + added parameter "white flag". Added one check more for distance form medic to wounded.   What's a bro? - A bro is a unit (AI or player) who can be revived while unconscious, if some conditions are met (hard coded like within 200 m of another bro, or configured). In case of several healer candidates, the closer is elected. - That's also a unit able to heal unconscious unit (SP/MP) under the same conditions. But here, player(s) are not engaged in the process. They can heal but if an AI meet the conditions, this one will start the process. So, healer/healed is the same family: Bros. In which, the players are free to heal or not.   How bros work (7th param or description.ext param class: bro ) - in SP, bros are switchable units by default. You can override this, passing a 7th param when calling MGI_fn_Revive, as shown in example (last code line). - in MP,     * if   bros   class is present in description.ext, you can't override it; You have to choose one of the two settings:             playable units or side player. Your description.ext should look like this (specifically for bros class):
         Bros = all players as default parameter means you can have different side and bros can heal anywhere.. if conditions are met.      Keep on mind that disabled AI (slots)  in lobby don't have existence and playableUnits = allPlayers (all playing guys), and not all playable units as in editor.      So, each time you can let the slot as AI enabled, it's better. The list is updated anyway.      The other possible parameter is set as WEST here.      * if these parameters are not fine for your scenario, you can modify the bros class but you have to change the working line referring to your values:      In the main function MGI_fn_Revive, look for:       if (MGI_bros isEqualType 0) then { MGI_bros = [switchableUnits+playableUnits, WEST] select ("bros" call BIS_fnc_getParamValue); <<<<< THIS LINE CAN BE MODIFIED: [<your default array of bros>,<another choice>] select ("bros" call BIS_fnc_getParamValue) } else { MGI_bros = _MGI_bros };        * You can also delete the  bros  class  in description.ext, and sets the 7th parameter as shown in the following example:     [nil,nil,nil,nil,nil,nil,east] call MGI_fn_Revive;     This way, here EAST will take place of the missing (and non over-writable) bros class. The other parameters are set to nil,  for not overriding the other existing classes.        * Don't forget, there is nothing mandatory, neither description.ext parameters, nor function parameters (See default above).      You can add any unit in "bros" team, just setting a variable: yourUnit (or cursorTarget)  setVariable ["passedBros",true,true];       Extra Examples:       call MGI_fn_Revive       //   parameters are default ones, or defined by your description.ext:  standard usage in MP (allowing parameters in description.ext)      [nil,nil,nil,nil,nil,nil,east] call MGI_fn_Revive;   // MP reworked/added side , class bros removed, other classes in description.ext      [30,60,true,0,false,1,independent] call MGI_fn_Revive;     //    this will override the  mission MP parameters in lobby, except the independent if bros class exist!   Better usage for SP       or even, in MP:            [nil,nil,nil,nil,nil,nil,west,false] call MGI_fn_Revive;
           sleep 2;
           [nil,nil,nil,nil,nil,nil,east,false] call MGI_fn_Revive;            Don't forget!  bros class must be inactive/deleted in description.ext