# Get Town Threats

Grammar — Get all the threats near the given town town of player player
FlagsNative | Function

Returns a unit group of all the threats near the given town of a player.

# Arguments

  • int — Player
  • int — Town

Returns — unitgroup

native unitgroup AIGetTownThreats(int player, int town);

Category: AI Advanced / Towns / Functions

# Examples

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:31


bool GAw3_AIThreatedByNonHostilePlayer(int player){
    unitgroup ug=AIGetTownThreats(player,-1);
    unitgroup ugH=UnitGroupFilterPlayer(ug,GAw3_AICreepPlayer,c_noMaxCount);
    if(ug==null){return false;}