• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to cancel training a unit

Status
Not open for further replies.
Level 8
Joined
Aug 4, 2006
Messages
357
Hey guys,

Quick question: In response to the event "building starts training a unit", how do I cancel training the unit? I can't find a function to do it.
An answer in any code form (GUI/JASS/vJASS) is welcome, but please, do NOT make up a function name that doesn't exist. Yes I know this question requires you to actually open up your world editor, but I will give rep to whoever solves it.

Edit: I solved the problem by doing a test in response to the EVENT_PLAYER_UNIT_ISSUED_ORDER event. When I press the cancel button, I print out the issued order id, which turns out to be 0x000d0008. Then I can cancel training a unit by doing the following:
JASS:
call IssueImmediateOrderById( udg_buildingUnit, 0x000d0008 )
 
Status
Not open for further replies.
Top