This is a rough idea, but this "might" be one way (assuming MP, otherwise public variables are just global instead). This is only pseudo code, I can have actual code written in the morning:
UnitA is the "shooter" (has 'fired" event handler added to him)
UnitB is the "victim" (has "hit" event added to him)
UnitA "fires" a weapon. The ammo type fired is stored as a global variable (local only on the client that controls UnitA) from _this select 4 according to the event handler.
UnitB is "hit" by something. The object (unit) that caused the damage is _this select 1 according to the event handler. The event handler and broadcasts a public variable with the value of _this select 1.
A looping script on all clients checks the public variable against the name of the unit of the client it is running on (in this case UnitA) and if the same, it broadcasts a public variable with the value of of the global variable of the last known ammo fired.
UnitB's receives this public variable and proceeds with that as the most likely type of ammo that damaged it.
I know there are some potentially big holes in this concept (time delay bombs, damage from vehicles (they need their own fired event handlers), among others) but I can't think of any other way except maybe a looping nearObjects search to try to capture the types of objects of that were near the victim before the hit event handler was triggered but I am not sure that will work.
EDIT: Here is the code I came up with. It is still theoretical and untested, I can't try it until tonight when I get home. This code doesn not take into account the new public variable event handlers option in v. 1.09
UnitA Init Line:this addEventHandler ["fired", {lastFiredAmmo = _this select 4}]; nul = this execVM "lastFiredAmmo.sqf";
The above adds a fired eventhandler to the unit that when triggered creates a global variable storing the last type of ammo fired by the unit. The init also executes a looping script that uses the global variable in case a unit is hit by the ammo.
UnitB Init Line:this addEventHandler ["hit", {lastHitBy = _this select 1; publicVariable "lastHitBy"; unitLastHit = _this select 0; newHit = true; publicVariable "newHit"; nul = this execVM "lastHitAmmo.sqf"}];
The above adds a hit event handler to the unit that when triggered broadcasts a public variable to all units recording the last unit to hit someone. The event handler broadcasts another public variable notifying all clients that a unit has been newly hit. Lastly the event handler executes a script that determines what type of ammo last hit the unit.
init.sqf
// Initialize global variables for later use
lastFiredAmmo = "";
lastHitBy = "";
unitLastHit = "";
newHit = false;
lastFiredAmmo = "";
lastHitAmmo = "";
lastFiredAmmo.sqf:
_localUnitF = _this;
while {newHit} do
{
if (lastHitBy == _localUnitF) then
{
publicVariable "lastFiredAmmo";
}
};
The above script loops waiting for newHit to return true. When it does it compares the unit that last hit someone with this unit. If they are the same a public variable is broadcast to all units with the type of ammo last fired.
lastHitAmmo.sqfsleep .5;
_localUnitH = _this;
_localUnitH setVariable ["lastHitAmmo", lastFiredAmmo];
newHit = false; publicVariable "newHit";
unitLastHit = "";
The above script is executed by the hit event handler. It waits to make sure that lastFireAmmo.sqf has had time to broadcast lastFiredAmmo and then sets the value of lastFiredAmmo to the unit's object. It then resets newHit and UnitLastHit for use by the next hit event.
Then when you need to find out what type of ammo last hit a unit for your medic script just use getVariable to retrieve it for that lastHitAmmo for that unit. I have not worked with set/getVariable much so I can't be much help there.
If will test this later today to see if it works...but in the meantime...
SECOND EDIT: I sneaked home at lunch and tested it. It works in the editor for a single unit with the hit event handler, so, this is encouraging. I will test more extensively later trying to get it to work with multiple units. In the meantime here is a demo mission as shown above. The shooter has an M16 and an M9. Shoot the civilian (try not to kill him) and then press 0-0-0 (Radio Juliet) to show the last known ammo to hit him. Switch weapons and hit 0-0-0 again to see the difference. It also works with grenades, I haven't tested satchels or other munitions.
(small error in the demo init. sqf. Change llastFiredAmmo to lastFiredAmmo. Sorry, doesnt' seem to affect the script and I will fix it later)