Unload to player inventory

This commit is contained in:
VKing 2015-12-17 19:25:22 +01:00
parent 27890a8dab
commit 579f861b8f
4 changed files with 16 additions and 16 deletions

View File

@ -55,14 +55,14 @@ class CfgVehicles {
displayName = CSTRING(loadMagazine_HE_Guided);
distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE_Guided')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_4(_target,_player,5,'ACE_1Rnd_82mm_Mo_HE_Guided')] call FUNC(loadMagazineTimer));
statement = QUOTE([ARR_4(_target,_player,6,'ACE_1Rnd_82mm_Mo_HE_Guided')] call FUNC(loadMagazineTimer));
icon = "";
};
class GVAR(loadMagazine_HE_LaserGuided) {
displayName = CSTRING(loadMagazine_HE_LaserGuided);
distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE_LaserGuided')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_4(_target,_player,5,'ACE_1Rnd_82mm_Mo_HE_LaserGuided')] call FUNC(loadMagazineTimer));
statement = QUOTE([ARR_4(_target,_player,6,'ACE_1Rnd_82mm_Mo_HE_LaserGuided')] call FUNC(loadMagazineTimer));
icon = "";
};
class GVAR(loadMagazine_Illum) {
@ -76,14 +76,14 @@ class CfgVehicles {
displayName = CSTRING(loadMagazine_Smoke);
distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_Smoke')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_4(_target,_player,3,'ACE_1Rnd_82mm_Mo_Smoke')] call FUNC(loadMagazineTimer));
statement = QUOTE([ARR_4(_target,_player,2.5,'ACE_1Rnd_82mm_Mo_Smoke')] call FUNC(loadMagazineTimer));
icon = "";
};
class GVAR(loadMagazine_HE) {
displayName = CSTRING(loadMagazine_HE);
distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_4(_target,_player,3,'ACE_1Rnd_82mm_Mo_HE')] call FUNC(loadMagazineTimer));
statement = QUOTE([ARR_4(_target,_player,2.5,'ACE_1Rnd_82mm_Mo_HE')] call FUNC(loadMagazineTimer));
icon = "";
};
};

View File

@ -9,7 +9,7 @@ class cfgMagazines {
descriptionShort = CSTRING(magazine_HE_descriptionShort);
model = PATHTOF(data\l16_ammo_he.p3d)
picture = PATHTOF(UI\w_l16_ammo_he_ca.paa);
mass = 10;
mass = 10; // Temporary value; should be increased
};
class 8Rnd_82mm_Mo_Smoke_white;
class ACE_1Rnd_82mm_Mo_Smoke: 8Rnd_82mm_Mo_Smoke_white {

View File

@ -25,15 +25,15 @@ _currentMagazine = (magazinesAllTurrets _static) select 1;
_currentMagazineClass = _currentMagazine select 0;
_ammoCount = _currentMagazine select 2;
//If current magazine is empty then remove it otherwise remove it and add it to the players inventory
if (_ammoCount == 0) then {
[QGVAR(removeMagazine), [_static, _currentMagazineClass]] call EFUNC(common,globalEvent);
}else {
_pos = _unit modelToWorldVisual [0,1,0];
// TODO: Check unit inventory space and add to inventory first, then drop
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addMagazineAmmoCargo [_currentMagazineClass, 1, _ammoCount];
_unit setPosATL _pos;
// Try to add the round to player inventory, otherwise place it on the ground near the player
if (_ammoCount > 0) then {
if (_unit canAdd _currentMagazineClass) then {
_unit addMagazineGlobal _currentMagazineClass;
} else {
_pos = _unit modelToWorldVisual [0.5,0.5,0]; // Front right of player
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addMagazineAmmoCargo [_currentMagazineClass, 1, _ammoCount];
_unit setPosATL _pos;
};
[QGVAR(removeMagazine), [_static, _currentMagazineClass]] call EFUNC(common,globalEvent);
};

View File

@ -136,7 +136,7 @@
<French>Ce module permet de régler les options du mortier MK6</French>
</Key>
<Key ID="STR_ACE_Mk6Mortar_unloadMortar">
<English>Unload Round</English>
<English>Remove Round</English>
</Key>
<Key ID="STR_ACE_Mk6Mortar_loadMortar">
<English>Load Mortar</English>