# Unit Is Allowed For Player
Grammar — inUnit is allowed for player inPlayer
Flags —Native|Function
Returns true if a unit is allowed for the specified player. Use “Allow/Disallow Unit For Player” to modify this.
# Arguments
int— Playerstring<gamelink::Unit> — Unit
Returns — bool
native bool TechTreeUnitIsAllowed(
int player,
string unitType,
);
# Related
Category: Tech Tree / Individual Restrictions
- Specific Requirements Are Enabled For Player —
bool— TechTreeSpecificRequirementEnabled - Enable/Disable SpecificTech Tree Requirements —
void— TechTreeSpecificRequirementEnable - Allow/Disallow Behavior For Player —
void— TechTreeBehaviorAllow - Allow/Disallow Ability For Player —
void— TechTreeAbilityAllow - Allow/Disallow Unit For Player —
void— TechTreeUnitAllow - Allow/Disallow Upgrade For Player —
void— TechTreeUpgradeAllow - Ability Is Allowed For Player —
bool— TechTreeAbilityIsAllowed - Behavior Is Allowed For Player —
bool— TechTreeBehaviorIsAllowed - Unit Is Allowed For Player —
bool— TechTreeUnitIsAllowed - Upgrade Is Allowed For Player —
bool— TechTreeUpgradeIsAllowed - Add Upgrade Level For Player —
void— TechTreeUpgradeAddLevel - Set Upgrade Level For Player —
void— libNtve_gf_SetUpgradeLevelForPlayer - Set Production Cap For Player —
void— TechTreeSetProduceCap - Production Cap For Player —
int— TechTreeGetProduceCap
# Examples
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:6026
lv_instance = UserDataInstance(auto845894D2_userType, auto845894D2_i);
lv_uT = UserDataGetUnit(libCOMI_gv_cM_Tychus_UserTypeHeroList, lv_instance, "Unit Type", 1);
if ((TechTreeUnitIsAllowed(lp_p, lv_uT) == true)) {
auto3D8DE2E4_ae = (TechTreeUnitProducedAbilCmdCount(lv_uT) - 1);
lv_i = 0;