wasDemolished(structure)

(info) Other great resources: Official JS API docs, Scripting Forum

wasDemolished(structure)

Determine if a destroyed structure was demolished by trucks or engineers.

 

Code

// Determine if a STRUCTURE object is being demolished function wasDemolished(structure) { return (!structure.status); // status == 0 if structure was demolished }

Example

function eventDestroyed(victim) { if (victim.type == STRUCTURE && wasDemolished(victim)) { playSound("pcv340.ogg"); // demolished } }