Skip to content

Destroy Placeables in all Areas by Tag

Is there a way to destroy all placeables with the same tag in every area at the same time?

I tried using this, but it's only checking the first area. I didn't see any "GetFirstObjectInModule" options...
void main() { object oTarget = GetModule(); object oObject = GetFirstObjectInArea(oTarget); while (oObject != OBJECT_INVALID) { if (GetTag(oObject)=="placeable_tag") DestroyObject(oObject); oObject = GetNextObjectInArea(oTarget); } }

Comments

  • GoranGoran Member Posts: 1
    edited May 2018
    void main() { int nth = 0; object oObject = GetObjectByTag("placeable_tag", nth); while (oObject != OBJECT_INVALID) { DestroyObject(oObject); oObject = GetObjectByTag("placeable_tag", ++nth); } }
Sign In or Register to comment.