# Command Error

Grammar — Player player hit command error error|Command Error using ability ability|Ability Command
FlagsNative | Event

Event that occurs when a player recieves a command error.

# Arguments

  • int — Player
  • int<preset::CommandResult> — Error
  • abilcmd — Ability

Returns — void

native void TriggerAddEventCommandError(
	trigger t,
	int player,
	int error,
	abilcmd inAbilCmd,
);

Category: UI / Command Error

# Examples

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:3316

    gt_SupplyHelperActivator = TriggerCreate("gt_SupplyHelperActivator_Func");
    TriggerEnable(gt_SupplyHelperActivator, false);
    TriggerAddEventCommandError(gt_SupplyHelperActivator, gv_p01_USER, c_cmdNotEnoughFood, null);
    TriggerAddEventAlert(gt_SupplyHelperActivator, gv_p01_USER, "TrainError");
}

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2mapMapScript.galaxy:3316

    gt_SupplyHelperActivator = TriggerCreate("gt_SupplyHelperActivator_Func");
    TriggerEnable(gt_SupplyHelperActivator, false);
    TriggerAddEventCommandError(gt_SupplyHelperActivator, gv_p01_USER, c_cmdNotEnoughFood, null);
    TriggerAddEventAlert(gt_SupplyHelperActivator, gv_p01_USER, "TrainError");
}