# Get Relationship Between Players
Grammar — Player sourcePlayer treats player targetPlayer as relation|Ally/Enemy/Neutral
Flags —Function
Returns true of the source player is treating the target player as ally, enemy, or neutral. Use the Mutual options to check if two players treat each other as mutual allies, enemies, or neutrals.
# Arguments
int
— Source Playerint
— Target Playerint
[ preset::PlayerRelation ] — Relation
Returns — bool
bool libNtve_gf_PlayerIsEnemy(
int lp_sourcePlayer,
int lp_targetPlayer,
int lp_relation,
);
# Related
Category: Player / Alliances
- [F] —
void
— Player Changes Alliances — ( TriggerAddEventPlayerAllianceChange ) - [F] —
void
— Set Alliance — ( libNtve_gf_SetAlliance ) - [F] —
void
— Set Alliance (One-Way) — ( libNtve_gf_SetAllianceOneWay ) - [F] —
void
— Set Alliance Aspect — ( PlayerSetAlliance ) - [F] —
void
— Set Alliance For Player Group — ( libNtve_gf_SetPlayerGroupAlliance ) - [F] —
void
— Set Alliance Between Two Player Groups — ( libNtve_gf_SetAllianceBetweenTwoPlayerGroups ) - [F] —
void
— Set Alliance Aspect For Player Group — ( libNtve_gf_SetAllianceAspectForPlayerGroup ) - [F] —
bool
— Alliance Aspect — ( PlayerGetAlliance ) - [F] —
bool
— Get Relationship Between Players — ( libNtve_gf_PlayerIsEnemy )
# Examples
# campaigns/liberty.sc2campaign
// L4224
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L5185
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), UnitGetOwner(libNtve_gf_KillingUnit()), libNtve_ge_PlayerRelation_Enemy)
// L2329
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_p01_USER, libNtve_ge_PlayerRelation_Enemy)
// L3397
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), UnitGetOwner(libNtve_gf_KillingUnit()), libNtve_ge_PlayerRelation_Enemy)
// L1256
libNtve_gf_PlayerIsEnemy(UnitGetOwner(libNtve_gf_KillingUnit()), gv_p2_RAYNOR_LIGHTBLUE, libNtve_ge_PlayerRelation_Enemy)
// L3271
libNtve_gf_PlayerIsEnemy(gv_pLAYER_01_USER, UnitGetOwner(EventUnit()), libNtve_ge_PlayerRelation_Enemy)
// L5149
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), UnitGetOwner(libNtve_gf_KillingUnit()), libNtve_ge_PlayerRelation_Enemy)
// L4224
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L5185
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), UnitGetOwner(libNtve_gf_KillingUnit()), libNtve_ge_PlayerRelation_Enemy)
// L2329
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_p01_USER, libNtve_ge_PlayerRelation_Enemy)
// L3397
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), UnitGetOwner(libNtve_gf_KillingUnit()), libNtve_ge_PlayerRelation_Enemy)
// L1256
libNtve_gf_PlayerIsEnemy(UnitGetOwner(libNtve_gf_KillingUnit()), gv_p2_RAYNOR_LIGHTBLUE, libNtve_ge_PlayerRelation_Enemy)
// L3271
libNtve_gf_PlayerIsEnemy(gv_pLAYER_01_USER, UnitGetOwner(EventUnit()), libNtve_ge_PlayerRelation_Enemy)
// L5149
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), UnitGetOwner(libNtve_gf_KillingUnit()), libNtve_ge_PlayerRelation_Enemy)
// L5079
libNtve_gf_PlayerIsEnemy(gv_pLAYER_01_USER, UnitGetOwner(EventUnit()), libNtve_ge_PlayerRelation_Enemy)
// L5100
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), UnitGetOwner(libNtve_gf_KillingUnit()), libNtve_ge_PlayerRelation_Enemy)
// L4889
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L7154
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L4733
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), UnitGetOwner(libNtve_gf_KillingUnit()), libNtve_ge_PlayerRelation_Enemy)
// L798
libNtve_gf_PlayerIsEnemy(gv_pLAYER_01_USER, UnitGetOwner(autoEACA5FB9_var), libNtve_ge_PlayerRelation_Ally)
// L4392
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L5084
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L7603
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L7657
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L1058
libNtve_gf_PlayerIsEnemy(lp_player, gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L1070
libNtve_gf_PlayerIsEnemy(lp_player, gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L1083
libNtve_gf_PlayerIsEnemy(lp_player, gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L4831
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), UnitGetOwner(lv_indexUnit), libNtve_ge_PlayerRelation_Enemy)
// L7010
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), UnitGetOwner(libNtve_gf_KillingUnit()), libNtve_ge_PlayerRelation_Enemy)
// L5100
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), UnitGetOwner(libNtve_gf_KillingUnit()), libNtve_ge_PlayerRelation_Enemy)
// L4889
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L7154
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L4733
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), UnitGetOwner(libNtve_gf_KillingUnit()), libNtve_ge_PlayerRelation_Enemy)
// L798
libNtve_gf_PlayerIsEnemy(gv_pLAYER_01_USER, UnitGetOwner(autoEACA5FB9_var), libNtve_ge_PlayerRelation_Ally)
// L4392
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L5084
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L7603
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L7657
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L1058
libNtve_gf_PlayerIsEnemy(lp_player, gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L1070
libNtve_gf_PlayerIsEnemy(lp_player, gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L1083
libNtve_gf_PlayerIsEnemy(lp_player, gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L4831
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), UnitGetOwner(lv_indexUnit), libNtve_ge_PlayerRelation_Enemy)
// L7010
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), UnitGetOwner(libNtve_gf_KillingUnit()), libNtve_ge_PlayerRelation_Enemy)
// L5079
libNtve_gf_PlayerIsEnemy(gv_pLAYER_01_USER, UnitGetOwner(EventUnit()), libNtve_ge_PlayerRelation_Enemy)
# campaigns/swarmstory.sc2campaign
// L1295
libNtve_gf_PlayerIsEnemy(lp_player, UnitGetOwner(autoEFB1326A_var), libNtve_ge_PlayerRelation_Ally)
# campaigns/void.sc2campaign
// L478
libNtve_gf_PlayerIsEnemy(UnitGetOwner(UnitGroupLoopCurrent()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L478
libNtve_gf_PlayerIsEnemy(UnitGetOwner(UnitGroupLoopCurrent()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_EnemyMutual)
// L482
libNtve_gf_PlayerIsEnemy(UnitGetOwner(UnitGroupLoopCurrent()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Neutral)
// L482
libNtve_gf_PlayerIsEnemy(UnitGetOwner(UnitGroupLoopCurrent()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_NeutralMutual)
// L486
libNtve_gf_PlayerIsEnemy(UnitGetOwner(UnitGroupLoopCurrent()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L486
libNtve_gf_PlayerIsEnemy(UnitGetOwner(UnitGroupLoopCurrent()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_NeutralMutual)
// L874
libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L874
libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_EnemyMutual)
// L878
libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Neutral)
// L878
libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_NeutralMutual)
// L4294
libNtve_gf_PlayerIsEnemy(gv_pLAYER_01_USER, UnitGetOwner(EventUnit()), libNtve_ge_PlayerRelation_Enemy)
// L5281
libNtve_gf_PlayerIsEnemy(gv_pLAYER_01_USER, UnitGetOwner(EventUnit()), libNtve_ge_PlayerRelation_Enemy)
// L2350
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2379
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2408
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2437
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2466
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2495
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2524
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2553
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2582
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2611
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L478
libNtve_gf_PlayerIsEnemy(UnitGetOwner(UnitGroupLoopCurrent()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L478
libNtve_gf_PlayerIsEnemy(UnitGetOwner(UnitGroupLoopCurrent()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_EnemyMutual)
// L482
libNtve_gf_PlayerIsEnemy(UnitGetOwner(UnitGroupLoopCurrent()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Neutral)
// L482
libNtve_gf_PlayerIsEnemy(UnitGetOwner(UnitGroupLoopCurrent()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_NeutralMutual)
// L486
libNtve_gf_PlayerIsEnemy(UnitGetOwner(UnitGroupLoopCurrent()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L486
libNtve_gf_PlayerIsEnemy(UnitGetOwner(UnitGroupLoopCurrent()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_NeutralMutual)
// L874
libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy)
// L874
libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_EnemyMutual)
// L878
libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Neutral)
// L878
libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_NeutralMutual)
// L4294
libNtve_gf_PlayerIsEnemy(gv_pLAYER_01_USER, UnitGetOwner(EventUnit()), libNtve_ge_PlayerRelation_Enemy)
// L5281
libNtve_gf_PlayerIsEnemy(gv_pLAYER_01_USER, UnitGetOwner(EventUnit()), libNtve_ge_PlayerRelation_Enemy)
// L2350
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2379
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2408
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2437
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2466
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2495
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2524
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2553
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2582
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
// L2611
libNtve_gf_PlayerIsEnemy(UnitGetOwner(EventUnit()), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally)
# campaigns/voidstory.sc2campaign
// L10264
libNtve_gf_PlayerIsEnemy(EventUnitDamageSourcePlayer(), EventPlayer(), libNtve_ge_PlayerRelation_Enemy)
# campaigns/voidstory.sc2campaign
— VoidCampaignMissionLib.galaxy
// L962
libNtve_gf_PlayerIsEnemy(1, lv_i, libNtve_ge_PlayerRelation_Enemy)
// L962
libNtve_gf_PlayerIsEnemy(1, lv_i, libNtve_ge_PlayerRelation_EnemyMutual)
// L3331
libNtve_gf_PlayerIsEnemy(lp_player, UnitGetOwner(auto5CF01D86_var), libNtve_ge_PlayerRelation_Ally)
# mods/core.sc2mod
// L3889
libNtve_gf_PlayerIsEnemy(lp_player, lv_itPlayer, lp_alliance)
# mods/heroesbrawlmods/arenamodemods/templearena.stormmod
// L324
libNtve_gf_PlayerIsEnemy(UnitGetOwner(libAMCT_gv_aRMSkyTemple[lp_templeIndex].lv_temple), UnitGetOwner(libAMCT_gv_aRMSkyTemple[lp_templeIndex].lv_targetUnit), libNtve_ge_PlayerRelation_Enemy)
# mods/heroesdata.stormmod
// L471
libNtve_gf_PlayerIsEnemy(lv_defenderOwner, lv_unitOwner, libNtve_ge_PlayerRelation_Enemy)
# mods/heroesdata.stormmod
// L9011
libNtve_gf_PlayerIsEnemy(UnitGetOwner(lv_itUnit), UnitGetOwner(lp_killedUnit), libNtve_ge_PlayerRelation_Enemy)
// L18997
libNtve_gf_PlayerIsEnemy(UnitGetOwner(lv_itUnit), UnitGetOwner(lv_dyingStructureUnit), libNtve_ge_PlayerRelation_Enemy)
# mods/heroesdata.stormmod
// L2300
libNtve_gf_PlayerIsEnemy(lp_player, lv_itPlayer, libNtve_ge_PlayerRelation_Ally)
// L2336
libNtve_gf_PlayerIsEnemy(lp_player, lv_itPlayer, libNtve_ge_PlayerRelation_Ally)