Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Saving screen space, not needed
- _x = configFile;
- //CfgMagazine
- _mag = "rhs_30rnd_545x39_7n10_ak";
- //CfgWeapon
- _weap = "rhs_weap_ak74m";
- //initSpeed on CfgWeapon (Overrides if greater than 0, acts as a multiplier if negative)
- _weapInitSpeed = getNumber (_x >> "CfgWeapons" >> _weap >> "initSpeed");
- //initSpeed on CfgMagazine is the default speed the bullet will be created with
- _magInitSpeed = getNumber (_x >> "CfgMagazines" >> _mag >> "initSpeed");
- _ammo = getText (_x >> "CfgMagazines" >> _mag >> "ammo");
- _ammoCaliber = getNumber (_x >> "CfgAmmo" >> _ammo >> "caliber");
- _initSpeed = 0;
- if (_weapInitSpeed < 0) then {
- //_weapInitSpeed is negative and therefore a multiplier, use abs() to get the positive result
- _initSpeed = abs(_magInitSpeed * _weapInitSpeed)
- } else {
- if (_weapInitSpeed > 0) then {
- //_weapInitSpeed is overwriting the CfgMagazine initSpeed
- _initSpeed = _weapInitSpeed;
- } else {
- //_weapInitSpeed is 0 and therefore does not affect the bullet speed
- _initSpeed = _magInitSpeed;
- }
- };
- //https://community.bistudio.com/wiki/CfgAmmo_Config_Reference#caliber
- _rha_penetration = _initSpeed * _ammoCaliber * 0.015;
- //Returns 8.16231mm RHA equiv penetration in this case
- _rha_penetration;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement