Did something similiar only based on the amount of enemies and allies, aswell as wounds.
Kinda never finished really cos I decided not to put it into my mp map:
_AI = _this select 0
;;Start normal AI behaviour check to see if enemy would like to surrender
#loopai
~1
enemies = _AI countenemy enemylist
allies = _AI countfriendly allylist
_d = 0
?(enemies >= 10) and (allies <= 5): goto "randomsurrender"
?(enemies >= 5) and (allies == 1): goto "surrender"
?(enemies >= 7) and (allies == 2): goto "surrender"
?(enemies >= 9) and (allies == 3): goto "randomsurrender"
?(getdammage _AI >= 0.5):goto "randomsurrender"
?(getdammage _AI >= 0.
:goto "randomsurrender2"
goto "loopai"
;;random surrender
#randomsurrender
~0.5
?(random 10 <= 1): goto "surrender"
goto "loopai"
#randomsurrender2
~0.5
?(random 10 <= 6): goto "surrender"
goto "loopai"
;; surrender
#surrender
~1
_AI sidechat "surrendering"
RemoveAllWeapons _AI
_AI removemagazines "handgrenade"
_AI removemagazines "handgrenade"
_AI switchmove "FXStandSurDown"
_AI setCaptive true
#surrendered
~2
?(Getdammage _AI >= 1):goto "end"
_d = _d + 1
?(_d == 10): goto "backtonormal"
goto "surrendered"
#backtonormal
;; Take back former weapon and get back to action state
goto "loopai"
#end
_AI switchmove "FXstandsurdead"
exit
As you see I didnt finish the backtonormal part of it which would mean giving the guy back the weapons he had before (wouldnt have been a problem really I guess) but I kinda had the problem of not getting off the surrender state (hands behind head) and I didnt need the script anyways anymore so I didnt bother anymore.