Item array

Malthan

New member
I can't find a tutorial about this and looking through diffrent scripts didn't help se, so I decided to ask:

How do you use arrays in mafia? I want to make an array of items, let me demonstrate what I mean in Java code:

Code:
ArrayList items = new ArrayList();
items.add(digital underground potion);
items.add(cologne of contempt);

How can I do this in mafia? In most scripts I looked at people use maps, but I don't need a map - I just need an array that I could fill with items and then hoepefully use something like

Code:
for item in items {

But I'm not sure if this works in mafia.
 

Bale

Minion
I'm afraid we don't have 1 dimensional arrays. The closest we come is this:

Code:
item [11] knoll;
knoll [0] = $item[spring];
knoll [1] = $item[cog];
knoll [2] = $item[sprocket];
knoll [3] = $item[empty meat tank];
knoll [4] = $item[tires];
knoll [5] = $item[Bugbear beanie];
knoll [6] = $item[bugbear bungguard];
knoll [7] = $item[Gnollish plunger];
knoll [8] = $item[Gnollish flyswatter];
knoll [9] = $item[frilly skirt];
knoll [10] = $item[Maiden wig];

Or perhaps you'd be more comfortable with this:

Code:
item [int] knoll;
knoll [count(knoll)] = $item[spring];
knoll [count(knoll)] = $item[cog];
knoll [count(knoll)] = $item[sprocket];
knoll [count(knoll)] = $item[empty meat tank];
knoll [count(knoll)] = $item[tires];
knoll [count(knoll)] = $item[Bugbear beanie];
knoll [count(knoll)] = $item[bugbear bungguard];
knoll [count(knoll)] = $item[Gnollish plunger];
knoll [count(knoll)] = $item[Gnollish flyswatter];
knoll [count(knoll)] = $item[frilly skirt];
knoll [count(knoll)] = $item[Maiden wig];
 
Last edited:
Top