Okay, what I ended up doing is creating an addAction command on the unit "prisoner":
capture = this addAction ["Capture Queen of Hearts", "trigger1.sqs"]
trigger1.sqs:
?!(alive prisoner): exit
target1 = true;
publicVariable "target1";
titletext ["The Queen of Spades has been escorted to the building courtyard","plain"];
exit;
Then I added a trigger with the condition:
target1
And activation line:
prisoner setCaptive true;
[prisoner] join group player;
prisoner setPos [2876.44,3508.52,1.96];
[] exec "trigger6.sqs";
prisoner removeAction capture;
hint "The Queen of Hearts has been captured";
And trigger6.sqs is:
prisoner enableAI "MOVE";
commandStop prisoner;
Because the prisoner unit is initially set to disableAI "MOVE"
Basically I would want the group leader of the player who initiates the capture action to take control of the prisoner unit. I was wondering if this way would work to do exacly that. Would this way work, or would the capture script run on everybody on the server and cause everyone to gain control of the prisoner unit?
I would also like the titletext script:
titletext ["The Queen of Spades has been escorted to the building courtyard","plain"];
to run privately only to the player who initiates the action
and the hint script:
hint "The Queen of Hearts has been captured";
to show up for everybody