Another way would be to loop generating all the sprites.
This loop also gives each entity a simple action that watches one particular
global variable.
If this global variable equals a set number, the entities then self-destruct.
EG
var trees_on = 1;
action tree_alive()
{ while(trees_on==1)
{ wait(1); }
ent_remove(me);
}
function create_trees()
{ ...
for(i=0; i<150; i++)
{
ent_create("tree.tga", vector(random(2000)-1000,random(2000)-1000,0), tree_alive);
}
...
}
// then just set "trees_on == 0" for one frame and all the trees will remove themselves.