# Wants To Surrender
Grammar — Player player wants to surrender
Flags —Native
|Function
Check if this player wants to concede a skirmish game.
# Arguments
int
— Player
Returns — bool
native bool AIGivingUp(int player);
# Related
Category: AI Advanced / Utility / Functions
- Is Point In Shrub —
bool
— InShrub - Is Campaign AI —
bool
— AIIsCampaign - Grab Unit —
unit
— AIGrabUnit - Get State —
int
— AIState - Get Flag —
bool
— AIGetFlag - Get Coop Flag —
bool
— AIGetCoopFlag - Unit Has AI Option —
bool
— UnitGetAIOption - Wants To Surrender —
bool
— AIGivingUp - AI Pathing Cost Map —
int
— AIPathingCostMap - AI Pathing Cost Unit —
int
— AIPathingCostUnit - AI Self Reinforce Point —
point
— AISelfReinforceDropPoint
# Examples
mods/liberty.sc2mod — base.sc2data/TriggerLibs/LibertyLib.galaxy:800
if (lv_player < 0) { break; }
if ((PlayerType(lv_player) == c_playerTypeComputer) && (AIIsCampaign(lv_player) == false)) {
if ((AIGivingUp(lv_player) == true) && (PlayerGroupHasPlayer(libLbty_gv_meleeSurrender_PlayersSurrendering, lv_player) == false) && (PlayerGroupHasPlayer(libLbty_gv_meleeSurrender_PlayersTried, lv_player) == false)) {
libLbty_gf_MeleeSurrender_AIWantToSurrender(lv_player);
}
mods/liberty.sc2mod — base.sc2data/TriggerLibs/LibertyLib.galaxy:806
}
if ((PlayerGroupHasPlayer(libLbty_gv_meleeSurrender_PlayersSurrendering, lv_player) == true) && ((PlayerStatus(lv_player) != c_playerStatusActive) || (AIGivingUp(lv_player) == false))) {
PlayerGroupRemove(libLbty_gv_meleeSurrender_PlayersSurrendering, lv_player);
DialogDestroy(libLbty_gv_meleeSurrender_Dialog[lv_player]);