If the building that is selected will be unique for the player (as in, each player will only own one of the building in question), then it wouldn't be too hard to make triggers that will allow you to kill that building when it is selected by that player. Otherwise, as Roy said, it would become increasingly complicated with each additional instance of that building the player owns, as you'd need to be able to tell them apart via locations in the map.
Also, doing it via keystroke is technically possible in multiplayer, if you setup a restriction of some kind which allows for slave triggers (triggers which force the player to act in a certain way in order to convey local information globally). The most important aspect of this type of trigger system is that it must desync someone for not obeying the system, which results in the player either definitely playing by the rules or not playing at all.
For example, if you wanted to make it so that pressing "X" while the chat box is closed would make the Supply Depot selected by the current player be destroyed, you could setup the following restriction:
- Having a Supply Depot selected for more than 3 seconds results in it dying.
- Having a Supply Depot selected for more than 3 seconds without pressing "X" will result in desync.
Inform players of this beforehand, with any sort of reasoning ("It is an unstable bomb and will kill you if you select it for too long" or something).
Then, make it so it won't desync the player if they press "X" with the chat box closed. This will result in the Supply Depot dying at the 3 second mark, rather than the player desyncing.
Alternatively, you could make it so they press "X" before selecting the building, and desync if they select the building without pressing "X" first. This will result in the building dying immediately if they press "X" and then select it.
However, due to the nature of the specific task you're trying to perform, I don't think slave triggers are the way to go. It would make more sense to remove the keystroke requirement and just go by the length of time the building is selected. I mainly just gave you the additional information so you would know all the possibilities, although there are better ways to do it here (like using a global action to trigger the building death, rather than a keystroke).
Personally, I would probably go with the option of having a unit or building in the corner of the map that serves this purpose. If it's a unit, I'd detect when it moves, and if it's a building, I'd detect when it produces a certain unit. Then I would give the player a few seconds to select the building they want to destroy, and kill it immediately.
If you want to go this way, I've developed a fairly simple system which should work regardless of how many buildings you are using, which will allow you to determine both the building's position with relatively few triggers and a single location (speaking of which, I should probably update the Identifying Index IDs thread with said information).
Let us know the specifics of what you're looking for now that you know some of the restrictions you have to work around.
Post has been edited 2 time(s), last time on Aug 29 2012, 4:00 am by Azrael.