Object event

This commit is contained in:
Githawk 2016-06-06 19:50:54 +02:00
parent d0509830e3
commit a2b9678b15
2 changed files with 12 additions and 12 deletions

View File

@ -31,9 +31,9 @@ if (GVAR(supply) == 1) then {
params ["_args"];
_args params [["_unit", objNull, [objNull]], ["_truck", objNull, [objNull]], ["_supplyCount", 0, [0]]];
if (_supplyCount > 0 ) then {
["displayTextStructured", [_unit], [[LSTRING(Hint_RemainingSupplyPoints), _supplyCount], 2, _unit]] call EFUNC(common,targetEvent);
["displayTextStructured", _unit, [[LSTRING(Hint_RemainingSupplyPoints), _supplyCount], 2, _unit]] call EFUNC(common,objectEvent);
} else {
["displayTextStructured", [_unit], [LSTRING(Hint_EmptySupplyPoints), 2, _unit]] call EFUNC(common,targetEvent);
["displayTextStructured", _unit, [LSTRING(Hint_EmptySupplyPoints), 2, _unit]] call EFUNC(common,objectEvent);
};
true
},
@ -64,9 +64,9 @@ if (GVAR(supply) == 1) then {
} count _magazines;
};
if (_supply > 1.5) then {
["displayTextStructured", [_unit], [[LSTRING(Hint_RemainingAmmo), _text], _supply, _unit, (_numChars/2.9)]] call EFUNC(common,targetEvent);
["displayTextStructured", _unit, [[LSTRING(Hint_RemainingAmmo), _text], _supply, _unit, (_numChars/2.9)]] call EFUNC(common,objectEvent);
} else {
["displayTextStructured", [_unit], [LSTRING(Hint_Empty), 2, _unit]] call EFUNC(common,targetEvent);
["displayTextStructured", _unit, [LSTRING(Hint_Empty), 2, _unit]] call EFUNC(common,objectEvent);
};
true
},

View File

@ -40,15 +40,15 @@ if (_maxMagazines == 1) then {
if (GVAR(level) == 1) then {
// Fill magazine completely
_vehicle setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath];
["displayTextStructured", [_unit], [[LSTRING(Hint_RearmedTriple), _rounds,
["displayTextStructured", _unit, [[LSTRING(Hint_RearmedTriple), _rounds,
getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"),
getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit]] call EFUNC(common,targetEvent);
getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit]] call EFUNC(common,objectEvent);
} else {
// Fill only at most _numRounds
_vehicle setMagazineTurretAmmo [_magazineClass, ((_vehicle magazineTurretAmmo [_magazineClass, _turretPath]) + _numRounds) min _rounds, _turretPath];
["displayTextStructured", [_unit], [[LSTRING(Hint_RearmedTriple), _numRounds,
["displayTextStructured", _unit, [[LSTRING(Hint_RearmedTriple), _numRounds,
getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"),
getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit]] call EFUNC(common,targetEvent);
getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit]] call EFUNC(common,objectEvent);
};
} else {
for "_idx" from 1 to (_maxMagazines+1) do {
@ -69,9 +69,9 @@ if (_maxMagazines == 1) then {
} else {
_vehicle setMagazineTurretAmmo [_magazineClass, _currentRounds + _numRounds, _turretPath];
};
["displayTextStructured", [_unit], [[LSTRING(Hint_RearmedTriple), _numRounds,
["displayTextStructured", _unit, [[LSTRING(Hint_RearmedTriple), _numRounds,
getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"),
getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit]] call EFUNC(common,targetEvent);
getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit]] call EFUNC(common,objectEvent);
} else {
// Fill current magazine completely and fill next magazine partially
_vehicle setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath];
@ -79,9 +79,9 @@ if (_maxMagazines == 1) then {
_vehicle addMagazineTurret [_magazineClass, _turretPath];
_vehicle setMagazineTurretAmmo [_magazineClass, _currentRounds, _turretPath];
};
["displayTextStructured", [_unit], [[LSTRING(Hint_RearmedTriple), _rounds,
["displayTextStructured", _unit, [[LSTRING(Hint_RearmedTriple), _rounds,
getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"),
getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit]] call EFUNC(common,targetEvent);
getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit]] call EFUNC(common,objectEvent);
};
};
_vehicle removeMagazineTurret [_magazineClass, _turretPath];