Using Switch to add proper ammo for randomized weapons

Matt L

OpenDayZ Rockstar!
so what i'm trying to do in essence is
Code:
_wep = "classname";
_wep2 = "classname";

_crateweps = [_wep,_wep2] call BIS_fnc_selectRandom;

_box addWeaponCargoGlobal [_crateweps,1];

switch (true) do {
    case "classname": { addMagazineCargoGlobal "classname" };
    case "classname": { addMagazineCargoGlobal "classname" };
    default {};
};

so the crate or player would get a random weapon then ammo based on the weapon, but I don't know if it's possible this way or can/should be done another way. Any ideas?



EDIT: Got it working, thanks Infistar!
 
Last edited:
Back
Top