In the MP campaign, one can "gift" units to the control of another player.

My question is: is there any corresponding code that could make this useful in scripting? Frankly, I have no idea where to begin looking, but if anyone has any ideas it would be greatly appreciated!