# Upgrade Is Allowed For Player

GrammarinUpgrade is allowed for player inPlayer
FlagsNative | Function

Returns true if an upgrade is allowed for the specified player. Use “Allow/Disallow Upgrade For Player” to modify this.

# Arguments

  • int — Player
  • string<gamelink::Upgrade> — Upgrade

Returns — bool

native bool TechTreeUpgradeIsAllowed(
	int player,
	string upgradeType,
);

Category: Tech Tree / Individual Restrictions

# Examples

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignLib.galaxy:1506

    // Implementation
    libVoiC_gf_PC_UpdateWeaponArmorUpgrades(1);
    if ((TechTreeUpgradeIsAllowed(1, "ProtossAirWeaponsLevel1") == true) && (libVoiC_gv_pCX_UpgradesTaught == false)) {
        libVoiC_gv_pCX_UpgradesTaught = true;
    }

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:3477

        Wait(0.1, c_timeGame);
    }
    if ((libVoiC_gv_pCX_UpgradesTaught == false) && (libVCMI_gv_pM_UpgradeUnit == null) && (UnitGetType(lp_teachUnit) == "CyberneticsCore") && (TechTreeUpgradeIsAllowed(1, "ProtossAirWeaponsLevel1") == true) && (libVoiC_gf_PC_CampaignInEpilogue() == false)) {
        if ((libNtve_gf_UnitIsUnderConstruction(lp_teachUnit) == true)) {
            while (true) {