# Wants To Surrender

Grammar — Player player wants to surrender
FlagsNative | Function

Check if this player wants to concede a skirmish game.

# Arguments

  • int — Player

Returns — bool

native bool AIGivingUp(int player);

Category: AI Advanced / Utility / Functions

# Examples

mods/liberty.sc2modbase.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.sc2modbase.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]);