Feature/1078 will remove key after sell vehicle

This commit is contained in:
Florian Kinder
2014-02-06 19:19:37 +01:00
parent 6b60d77aaf
commit cc6acb6d8c

View File

@@ -1,4 +1,4 @@
private ["_veh","_location","_isOk","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_keyColor","_keyNumber","_keySelected","_isKeyOK","_config","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_canAfford","_trade_total","_total_currency","_return_change","_done"];
private ["_veh","_location","_isOk","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_keyColor","_keyNumber","_keySelected","_isKeyOK","_config","_damage","_tireDmg","_tires","_okToSell","_temp_keys","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_canAfford","_trade_total","_total_currency","_return_change","_done"];
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_103") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
@@ -216,6 +216,7 @@ if (_finished) then {
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
_objectCharacterId = _obj getVariable ["CharacterID","0"];
_notSetup = (_objectID == "0" && _objectUID == "0");
@@ -223,8 +224,6 @@ if (_finished) then {
if(_okToSell) then {
//if(_objectID != "0" && _objectUID != "0") then {
PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer];
@@ -232,6 +231,17 @@ if (_finished) then {
deleteVehicle _obj;
// remove Key
_temp_keys = [];
_keyColor = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
{
if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then {
if (getNumber(configFile >> "CfgWeapons" >> _x >> "keyid") == _objectCharacterId) then {
[_activatingPlayer,_x] call BIS_fnc_invRemove;
};
};
} forEach (items _activatingPlayer);
// payout
_canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange;