CfgWeapons – Take On Helicopters Talk
Jump to navigation
Jump to search
m (Created page with "== Export == For export, use following code: <pre>startloadingscreen [""]; _types = [ 0, "Default", 1, "Rifle", 2, "Handgun", 4096, "Item", 65536, "Mounted" ]; _cfg = c...") |
Lou Montana (talk | contribs) m (Text replacement - " (={2,})([^ = ])(.*)([^ = ])(={2,}) * " to " $1 $2$3$4 $5 ") |
||
(One intermediate revision by one other user not shown) | |||
Line 39: | Line 39: | ||
"|- | "|- | ||
| | | | ||
===%1=== | ==== %1 ==== | ||
| %2 | | %2 | ||
| %3 | | %3 |
Latest revision as of 19:17, 31 January 2021
Export
For export, use following code:
startloadingscreen [""]; _types = [ 0, "Default", 1, "Rifle", 2, "Handgun", 4096, "Item", 65536, "Mounted" ]; _cfg = configfile >> "cfgWeapons"; _cfgCount = count _cfg - 1; _export = ""; for "_c" from 0 to _cfgCount do { _class = _cfg select _c; if (isclass _class) then { _scope = getnumber (_class >> "scope"); _displayName = gettext (_class >> "displayName"); if (_scope > 0 && _displayName != "") then { _className = configname _class; _type = getnumber (_class >> "type"); _typeId = _types find _type; if (_typeId < 0) then {_typeId = 0}; _type = _types select (_typeId + 1); _magazines = getarray (_class >> "magazines"); _magazinesExport = ""; { _magazinesExport = _magazinesExport + format [" * ""%1"" ",_x]; } foreach _magazines; _export = _export + format [ "|- | ==== %1 ==== | %2 | %3 | %4 ", _className, _displayName, _type, _magazinesExport ]; }; }; progressloadingscreen (_c / _cfgCount); }; copytoclipboard _export; endloadingscreen;