# Command Error
Grammar — Player player hit command error error|Command Error using ability ability|Ability Command
Flags —Native
|Event
Event that occurs when a player recieves a command error.
# Arguments
int
— Playerint
<preset::CommandResult> — Errorabilcmd
— Ability
Returns — void
native void TriggerAddEventCommandError(
trigger t,
int player,
int error,
abilcmd inAbilCmd,
);
# Related
Category: UI / Command Error
- Command Error —
void
— TriggerAddEventCommandError - Command Result — preset —
int
- Command Error Value —
int
<preset::CommandResult> — EventCommandErrorValue - Command Error Ability Command —
abilcmd
— EventCommandErrorAbilCmd
# Examples
campaigns/void.sc2campaign — base.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.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");
}