Jump to content

Home

scripting - destroying multiple placeables


newbiemodder

Recommended Posts

My scripting syntax isn't great, but the general framework of the while function should do some good.

 

 

void main(){

int int1 = 0;

object DestroyMe = GetObjectByTag("itemtag", int1);

 

while ( DestroyMe != OBJECT_INVALID){

 

DestroyObject(DestroyMe);

 

(int1++);

 

DestroyMe = GetObjectByTag("itemtag", in1);

}}

Link to comment
Share on other sites

Here's another way plus you add more npc's to destroy if you like Just add a new sub1 line with a differant tag.

void sub1(string stringParam1) {
int int1 = 0;
object object1 = GetObjectByTag(stringParam1, int1);
while (GetIsObjectValid(object1)) {
	DestroyObject(object1, 0.0, 0, 0.0, 0);
	object1 = GetObjectByTag(stringParam1, (int1++));
}
}

void main() {
sub1("[color="Red"]itemtag[/color]");
}  

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...