Modifying some scripts in my menu

Posts 1–11 of 11 · Page 1 of 1
Modifying some scripts in my menu
Whenever i spawn a weapon from my menu, it gives me ALL possible magazines that it may accept, even if my inventory space gets full.

I'm wondering how can i change that?
#bump

really kinda need to figure this out!
post the code. i might be able to help ya
post your script to pastebin then put the link here and ill have a quick look. A quick fix around it for now is if you drop your weapon then pick it back up.
Quote Originally Posted by typh0 View Post
post your script to pastebin then put the link here and ill have a quick look. A quick fix around it for now is if you drop your weapon then pick it back up.
i could do that, but since it fills my inventory with over 10 slots of capacity i cant do it as fast as battleye can kick me for "addmagazine cargo restriction"

I'll post the script of "addmagazine" over here[COLOR="Silver"]

---------- Post added at 02:43 PM ---------- Previous post was at 02:39 PM ----------

Code:
_weapon = _this select 0;
player addWeapon _weapon;

_magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");

// foreach loop
{
	player addmagazine _x;
	player addmagazine _x;
	player addmagazine _x;
	player addmagazine _x;
} foreach _magazines;

reload player;
/\
this is my "addweapon" script (there's other's actually)

Code:
_weapon = currentWeapon player;
_mags = getArray(configfile >> 'cfgWeapons' >> _weapon >> 'magazines');
_mag = _mags select 0;
player addMagazine _mag;
player addMagazine _mag;
player addMagazine _mag;
/\ this is the "giveammo" script
Quote Originally Posted by JackKellar View Post
i could do that, but since it fills my inventory with over 10 slots of capacity i cant do it as fast as battleye can kick me for "addmagazine cargo restriction"

I'll post the script of "addmagazine" over here[COLOR="Silver"]

---------- Post added at 02:43 PM ---------- Previous post was at 02:39 PM ----------

Code:
_weapon = _this select 0;
player addWeapon _weapon;

_magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");

// foreach loop
{
	player addmagazine _x;
	player addmagazine _x;
	player addmagazine _x;
	player addmagazine _x;
} foreach _magazines;

reload player;
/\
this is my "addweapon" script (there's other's actually)

Code:
_weapon = currentWeapon player;
_mags = getArray(configfile >> 'cfgWeapons' >> _weapon >> 'magazines');
_mag = _mags select 0;
player addMagazine _mag;
player addMagazine _mag;
player addMagazine _mag;
/\ this is the "giveammo" script


Change the give ammo script to this
Code:
_weapon = currentWeapon player;
_mags = getArray(configfile >> 'cfgWeapons' >> _weapon >> 'magazines');
_mag = _mags select 0;
player addMagazine _mag;
then it will give you 1 of each mag type rather than 3
Quote Originally Posted by typh0 View Post
Change the give ammo script to this
Code:
_weapon = currentWeapon player;
_mags = getArray(configfile >> 'cfgWeapons' >> _weapon >> 'magazines');
_mag = _mags select 0;
player addMagazine _mag;
then it will give you 1 of each mag type rather than 3
what about the "give weapon" one? it will keep doing the same thing because it still has the same code into it? (im sorry for such stupid questions)
you could also just switch to rustlers. guns spawn with 3 mags I think
Quote Originally Posted by JackKellar View Post
Whenever i spawn a weapon from my menu, it gives me ALL possible magazines that it may accept, even if my inventory space gets full.

I'm wondering how can i change that?
Aside from the shit everyone else is saying about "learn your shit" basically...

You can probably look through the script, find where it adds your magazines (It will say addmagazine somewhere) and then see how it handles it.
try it and let me know
Quote Originally Posted by typh0 View Post
try it and let me know
Cant edit it for some reason
-----------------------------------------------------------------------------------
EDIT: nevermind, it was set to read only -_-

i'll tell you if it works
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?