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); displayName = CSTRING(loadMagazine_HE_Guided);
distance = 2; distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE_Guided')] call FUNC(canLoadMagazine)); 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 = ""; icon = "";
}; };
class GVAR(loadMagazine_HE_LaserGuided) { class GVAR(loadMagazine_HE_LaserGuided) {
displayName = CSTRING(loadMagazine_HE_LaserGuided); displayName = CSTRING(loadMagazine_HE_LaserGuided);
distance = 2; distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE_LaserGuided')] call FUNC(canLoadMagazine)); 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 = ""; icon = "";
}; };
class GVAR(loadMagazine_Illum) { class GVAR(loadMagazine_Illum) {
@ -76,14 +76,14 @@ class CfgVehicles {
displayName = CSTRING(loadMagazine_Smoke); displayName = CSTRING(loadMagazine_Smoke);
distance = 2; distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_Smoke')] call FUNC(canLoadMagazine)); 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 = ""; icon = "";
}; };
class GVAR(loadMagazine_HE) { class GVAR(loadMagazine_HE) {
displayName = CSTRING(loadMagazine_HE); displayName = CSTRING(loadMagazine_HE);
distance = 2; distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE')] call FUNC(canLoadMagazine)); 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 = ""; icon = "";
}; };
}; };

View File

@ -9,7 +9,7 @@ class cfgMagazines {
descriptionShort = CSTRING(magazine_HE_descriptionShort); descriptionShort = CSTRING(magazine_HE_descriptionShort);
model = PATHTOF(data\l16_ammo_he.p3d) model = PATHTOF(data\l16_ammo_he.p3d)
picture = PATHTOF(UI\w_l16_ammo_he_ca.paa); 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 8Rnd_82mm_Mo_Smoke_white;
class ACE_1Rnd_82mm_Mo_Smoke: 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; _currentMagazineClass = _currentMagazine select 0;
_ammoCount = _currentMagazine select 2; _ammoCount = _currentMagazine select 2;
//If current magazine is empty then remove it otherwise remove it and add it to the players inventory // Try to add the round to player inventory, otherwise place it on the ground near the player
if (_ammoCount == 0) then { if (_ammoCount > 0) then {
[QGVAR(removeMagazine), [_static, _currentMagazineClass]] call EFUNC(common,globalEvent); if (_unit canAdd _currentMagazineClass) then {
}else { _unit addMagazineGlobal _currentMagazineClass;
_pos = _unit modelToWorldVisual [0,1,0]; } else {
// TODO: Check unit inventory space and add to inventory first, then drop _pos = _unit modelToWorldVisual [0.5,0.5,0]; // Front right of player
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"]; _unit addMagazineAmmoCargo [_currentMagazineClass, 1, _ammoCount];
_unit addMagazineAmmoCargo [_currentMagazineClass, 1, _ammoCount]; _unit setPosATL _pos;
_unit setPosATL _pos; };
[QGVAR(removeMagazine), [_static, _currentMagazineClass]] call EFUNC(common,globalEvent); [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> <French>Ce module permet de régler les options du mortier MK6</French>
</Key> </Key>
<Key ID="STR_ACE_Mk6Mortar_unloadMortar"> <Key ID="STR_ACE_Mk6Mortar_unloadMortar">
<English>Unload Round</English> <English>Remove Round</English>
</Key> </Key>
<Key ID="STR_ACE_Mk6Mortar_loadMortar"> <Key ID="STR_ACE_Mk6Mortar_loadMortar">
<English>Load Mortar</English> <English>Load Mortar</English>