Just use a for loop, and just create all of them in the loop.
I'm sure you're going to be using light bars as such (Most common usage)
Regardless though, just make an array of objects, which will be used in this instance.
Code is untested, but it's just for example. CreateObject is just put there to show where you want it.
VV This is likely to need checking, 24 is because arrays start at 0, and so, 24, will actually be 25 as such.
Код:
#define MAX_LIGHTBARS 24
Код:
new LightBars[MAX_LIGHTBARS];
Код:
for (new i = 0; i != MAX_LIGHTBARS; ++i)
{
LightBars[i]=CreateObject(blahdeblah);
}
Because you are attaching them later, they can be put anywhere (Under map is ideal, just in a spot where they won't be visible)