# Ability Is Allowed For Player

GrammarabilCmd is allowed for player p
FlagsNative | Function

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

# Arguments

  • int — Player
  • abilcmd — Ability Command

Returns — bool

native bool TechTreeAbilityIsAllowed(
	int player,
	abilcmd inAbilCmd,
);

Category: Tech Tree / Individual Restrictions

# Examples

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:723


    if ((libCamp_gf_StoryState(libCamp_ge_StoryStateID_StoryStateTipFactoryPlayed) == 0)) {
        if ((TechTreeAbilityIsAllowed(1, AbilityCommand("TerranBuild", 10)) == true)) {
            libCamp_gf_SetStoryState(libCamp_ge_StoryStateID_StoryStateTipFactoryPlayed, 1);
            libCamp_gf_CreateTipFromConversationState("StoryTips|MissionNewStructureFactory", libNtve_ge_TipType_NewStructure, PlayerGroupAll());

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:732


    if ((libCamp_gf_StoryState(libCamp_ge_StoryStateID_StoryStateTipStarportPlayed) == 0)) {
        if ((TechTreeAbilityIsAllowed(1, AbilityCommand("TerranBuild", 11)) == true)) {
            libCamp_gf_SetStoryState(libCamp_ge_StoryStateID_StoryStateTipStarportPlayed, 1);
            libCamp_gf_CreateTipFromConversationState("StoryTips|MissionNewStructureStarport", libNtve_ge_TipType_NewStructure, PlayerGroupAll());

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:7143


    // Implementation
    if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 3)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 2)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 5)) == true))) {
        lv_allowDisallowBarracksTechLab = true;
    }

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:7143


    // Implementation
    if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 3)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 2)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 5)) == true))) {
        lv_allowDisallowBarracksTechLab = true;
    }

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:7143


    // Implementation
    if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 3)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 2)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 5)) == true))) {
        lv_allowDisallowBarracksTechLab = true;
    }

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:7143


    // Implementation
    if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 3)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 2)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 5)) == true))) {
        lv_allowDisallowBarracksTechLab = true;
    }

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:7143


    // Implementation
    if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 3)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 2)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 5)) == true))) {
        lv_allowDisallowBarracksTechLab = true;
    }

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:7149

        lv_allowDisallowBarracksTechLab = false;
    }
    if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 5)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 6)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 7)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 8)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 9)) == true))) {
        lv_allowDisallowFactory = true;
    }

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:7149

        lv_allowDisallowBarracksTechLab = false;
    }
    if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 5)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 6)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 7)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 8)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 9)) == true))) {
        lv_allowDisallowFactory = true;
    }

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:7149

        lv_allowDisallowBarracksTechLab = false;
    }
    if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 5)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 6)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 7)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 8)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 9)) == true))) {
        lv_allowDisallowFactory = true;
    }

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

    // Implementation
    if ((AbilityCommandGetAbility(UserDataGetAbilCmd("CampaignPerk", lp_ability, "AbilityCommand", 1)) != null)) {
        return TechTreeAbilityIsAllowed(1, UserDataGetAbilCmd("CampaignPerk", lp_ability, "AbilityCommand", 1));
    }
    else {

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:9790

    // Automatic Variable Declarations
    // Implementation
    if ((lp_abilityCommand != null) && (TechTreeAbilityIsAllowed(lp_player, lp_abilityCommand) == false)) {
        return true;
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOUI.galaxy:4660

            if ((CatalogFieldValueGet(c_gameCatalogUnit, "SoACaster", ((lv_path + ".Type")), lp_player) == "AbilCmd") && (CatalogFieldValueGetAsInt(c_gameCatalogUnit, "SoACaster", ((lv_path + ".Row")), lp_player) == 0) && (CatalogFieldValueGetAsInt(c_gameCatalogUnit, "SoACaster", ((lv_path + ".Column")), lp_player) == (lp_slot-1))) {
                lv_command = StringToAbilCmd(CatalogFieldValueGet(c_gameCatalogUnit, "SoACaster", ((lv_path + ".AbilCmd")), lp_player));
                if ((TechTreeAbilityIsAllowed(lp_player, lv_command) == true)) {
                    return lv_command;
                }