Hi
I'm trying to get the following script to work but have run into a problem.
It doesn't seem to read the %1 parameter - probably because the _text variable is defined within the {} brackets, and %1 is outside of those brackets. This is just my guess though, I could be wrong.
What would I need to do, to get the _text variable to read the %1 - which in this case would be "M9SD"?
Code:
_cweapon = primaryWeapon player;
_text = if (_cweapon == "") then {
player addWeapon '%1';
_mags = getArray(configfile >> 'cfgWeapons' >> '%1' >> 'magazines');
_mag = _mags select 0;
player addMagazine _mag;
player selectWeapon '%1';
reload player;
}
else {
player removeWeapon _cweapon;
player removeMagazines _cweapon;
player addWeapon '%1';
_mags = getArray(configfile >> 'cfgWeapons' >> '%1' >> 'magazines');
_mag = _mags select 0;
player addMagazine _mag;
player selectWeapon '%1';
reload player;
}
spawnweapons1 =
[
["", true],
["=================================", [-1], "", -5, [["expression", ""]], "1", "0"],
["M9SD", [2], "", -5, [["expression", format[_text, "M9SD"]]], "1", "1"],
["Exit", [-1], "", -3, [["expression", ""]], "1", "1"]
];
All help would be much appreciated!