SolvedNeed help with script

Posts 1–4 of 4 · Page 1 of 1
Need help with script
So i downloaded crinkly's twisted menu edit, but the give ammo option doesn't work and when i spawn a gun in it only gives me 1 clip.
Here is the code for the give ammo
Give ammo:
_unit = _this select 0;
_weapon = currentWeapon _unit;
_cfg = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
_unit addMagazine (_cfg select 0);
_unit addMagazine (_cfg select 0);
_unit addMagazine (_cfg select 0);
_unit addMagazine (_cfg select 0);
_unit addMagazine (_cfg select 0);


Can anyone help? I tried several things but i'm a n00b and i don't know why the hell it isnt working. Help would be much appreciated
Quote Originally Posted by sharkeel View Post
So i downloaded crinkly's twisted menu edit, but the give ammo option doesn't work and when i spawn a gun in it only gives me 1 clip.
Here is the code for the give ammo
Give ammo:
_unit = _this select 0;
_weapon = currentWeapon _unit;
_cfg = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
_unit addMagazine (_cfg select 0);
_unit addMagazine (_cfg select 0);
_unit addMagazine (_cfg select 0);
_unit addMagazine (_cfg select 0);
_unit addMagazine (_cfg select 0);


Can anyone help? I tried several things but i'm a n00b and i don't know why the hell it isnt working. Help would be much appreciated
I havnt seen anything written like that
Code:
_unit = _this select 0;
that would only be used for taking a value from an array.

try this

Code:
_weapon = currentWeapon player;
_cfg = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
player addMagazine (_cfg select 0);
player addMagazine (_cfg select 0);
player addMagazine (_cfg select 0);
player addMagazine (_cfg select 0);
player addMagazine (_cfg select 0);
Hmm i will. Thanks.

Brilliant! You helped a lot mate. Thank you!
Quote Originally Posted by sharkeel View Post
Hmm i will. Thanks.

Brilliant! You helped a lot mate. Thank you!
Solved.
/Closed
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Talk with us