diff --git a/A3A/addons/Garage/Public/fn_addVehicle.sqf b/A3A/addons/Garage/Public/fn_addVehicle.sqf index eed5250cec..ed17a3bc38 100644 --- a/A3A/addons/Garage/Public/fn_addVehicle.sqf +++ b/A3A/addons/Garage/Public/fn_addVehicle.sqf @@ -57,16 +57,18 @@ if (_class in [FactionGet(occ,"surrenderCrate"), FactionGet(inv,"surrenderCrate" true }; - -//Utility refund and Fuel refund +//Utility refund if (_vehicle getVariable ['A3A_canGarage', false]) exitwith{ - if (_class in [FactionGet(reb,"vehicleFuelDrum"), FactionGet(reb,"vehicleFuelTank")]) then { - [floor ( - [_vehicle] call A3A_fnc_remainingFuel * - (_vehicle getVariable ['A3A_itemPrice', 0]) - )] remoteExec ["A3A_fnc_resourcesPlayer", _client]; - ["STR_HR_GRG_Feedback_addVehicle_Fuel_sold"] remoteExec ["HR_GRG_fnc_Hint", _client]; - deleteVehicle _vehicle; + if (_class in [FactionGet(reb,"vehicleFuelDrum") # 0, FactionGet(reb,"vehicleFuelTank") # 0]) then { + if (_player isEqualTo theBoss) then { + [floor ( + ([_vehicle] call A3A_fnc_remainingFuel) * (_vehicle getVariable ['A3A_itemPrice', 0]) + )] remoteExec ["A3A_fnc_resourcesPlayer", _client]; + ["STR_HR_GRG_Feedback_addVehicle_Fuel_sold"] remoteExec ["HR_GRG_fnc_Hint", _client]; + deleteVehicle _vehicle; + } else { + ["STR_HR_GRG_Feedback_addVehicle_Fuel_commander_only"] remoteExec ["HR_GRG_fnc_Hint", _client]; + }; } else { [_vehicle getVariable ['A3A_itemPrice', 0]] remoteExec ["A3A_fnc_resourcesPlayer", _client]; ["STR_HR_GRG_Feedback_addVehicle_Item_Stored"] remoteExec ["HR_GRG_fnc_Hint", _client]; diff --git a/A3A/addons/Garage/Stringtable.xml b/A3A/addons/Garage/Stringtable.xml index d2986e7e68..9464bb3c34 100644 --- a/A3A/addons/Garage/Stringtable.xml +++ b/A3A/addons/Garage/Stringtable.xml @@ -203,6 +203,10 @@ Fuel sold Fuel sold + + Fuel sources can only be garaged by commander + Fuel sources can only be garaged by commander + You can't garage vehicles that are more than 25m away from you You can't garage vehicles that are more than 25m away from you diff --git a/A3A/addons/core/Templates/Templates/FactionDefaults/RebelDefaults.sqf b/A3A/addons/core/Templates/Templates/FactionDefaults/RebelDefaults.sqf index cee862998f..aedd4532ec 100644 --- a/A3A/addons/core/Templates/Templates/FactionDefaults/RebelDefaults.sqf +++ b/A3A/addons/core/Templates/Templates/FactionDefaults/RebelDefaults.sqf @@ -13,5 +13,5 @@ ["flyGear", ["U_I_pilotCoveralls"]] call _fnc_saveToTemplate; ["vehicleLightSource", "Land_LampShabby_F"] call _fnc_saveToTemplate; -["vehicleFuelDrum", ["FlexibleTank_01_forest_F", 80]] call _fnc_saveToTemplate; +["vehicleFuelDrum", ["FlexibleTank_01_forest_F", 160]] call _fnc_saveToTemplate; ["vehicleFuelTank", ["B_Slingload_01_Fuel_F", 1000]] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/functions/UtilityItems/fn_buyItem.sqf b/A3A/addons/core/functions/UtilityItems/fn_buyItem.sqf index 63ecdba326..41fd25e4cb 100644 --- a/A3A/addons/core/functions/UtilityItems/fn_buyItem.sqf +++ b/A3A/addons/core/functions/UtilityItems/fn_buyItem.sqf @@ -3,7 +3,7 @@ Author: [Killerswin2, Håkon] trys to purchase a item and places it near the player. Damage for the object is disabled. Arguments: 0. Unit that will be buying a light -1. Item classname +1. Item classname 2. price of item 3. callback functions, [[name, isGlobal - > true if need exec]] @@ -37,18 +37,26 @@ if (_price == 0) exitwith {}; private _lastTimePurchase = _unit getVariable["A3A_spawnItem_cooldown",time]; if (_lastTimePurchase > time) exitwith {["Item Purchase", format ["You already bought one, wait %1 seconds before you can buy another.", ceil (_lastTimePurchase - time)]] call A3A_fnc_customHint;}; -//find out if we have money -private _money = player getVariable ["moneyX", 0]; -if (_money < _price) exitwith {["Item Purchase", "You can't afford this Item."] call A3A_fnc_customHint}; -_unit setVariable["A3A_spawnItem_cooldown", time + 15]; - -//take money away -[-_price] call A3A_fnc_resourcesPlayer; +//try to take money away 😞 +private _insufficientFunds = isNil { + if (_unit == theBoss && (server getVariable ["resourcesFIA", 0]) >= _price) then { + [0,(-_price)] remoteExec ["A3A_fnc_resourcesFIA",2]; + true; + } else { + if ((_unit getVariable ["moneyX", 0]) >= _price) then { + [-_price] call A3A_fnc_resourcesPlayer; + true; + }; + }; +}; +if (_insufficientFunds) exitwith {["Item Purchase", "You can't afford this Item."] call A3A_fnc_customHint}; +//had money for item +_unit setVariable ["A3A_spawnItem_cooldown", time + 15]; //spawn the Item -_position = (getPos _unit vectorAdd [3,0,0]) findEmptyPosition [1,10,_spawnItem]; +private _position = (getPos _unit vectorAdd [3,0,0]) findEmptyPosition [1,10,_spawnItem]; if (_position isEqualTo []) then {_position = getPos _unit}; private _item = _spawnItem createVehicle _position; _item allowDamage false; @@ -64,6 +72,6 @@ _item setVariable ["A3A_itemPrice", _price, true]; private _jipKey = "A3A_utilityItems_item_" + ((str _item splitString ":") joinString ""); [_item, _jipKey] remoteExecCall [_func_name, 0, _jipKey]; } else { - [_item] spawn (missionNamespace getVariable _func_name); + [_item] call (missionNamespace getVariable _func_name); }; } foreach (_callbacks); diff --git a/A3A/addons/core/functions/init/fn_initClient.sqf b/A3A/addons/core/functions/init/fn_initClient.sqf index 183a86149a..039d09442e 100644 --- a/A3A/addons/core/functions/init/fn_initClient.sqf +++ b/A3A/addons/core/functions/init/fn_initClient.sqf @@ -401,16 +401,16 @@ if (A3A_hasACE) then { [vehicleBox, VehicleBox] call ace_common_fnc_claim;}; //D }},nil,0,false,true,"","(isPlayer _this) and (_this == _this getVariable ['owner',objNull]) and (side (group _this) == teamPlayer)", 4]; #endif vehicleBox addAction ["Move this asset", A3A_fnc_moveHQObject,nil,0,false,true,"","(_this == theBoss)", 4]; -vehicleBox addAction ["Buy Light for 25€", {[player, 'vehicleLightSource', 25, [['A3A_fnc_initMovableObject', 0]]] call A3A_fnc_buyItem},nil,0,false,true,"","true",4]; +vehicleBox addAction ["Buy Light for 25€", {[player, FactionGet(reb,"vehicleLightSource"), 25, [['A3A_fnc_initMovableObject', false]]] call A3A_fnc_buyItem},nil,0,false,true,"","true",4]; private _fuelDrum = FactionGet(reb,"vehicleFuelDrum"); private _fuelTank = FactionGet(reb,"vehicleFuelTank"); if (isClass (configFile/"CfgVehicles"/_fuelDrum # 0)) then { private _dispName = getText (configFile/"CfgVehicles"/_fuelDrum # 0/"displayName"); - vehicleBox addAction [format["Buy %1 for %2€",_dispName, _fuelDrum # 1], {[player, _this # 3 # 0, _this # 3 # 1, [['A3A_fnc_initMovableObject', true], ['A3A_fnc_logistics_addLoadAction', false]]] call A3A_fnc_buyItem},_fuelDrum,0,false,true,"","true",4]; + vehicleBox addAction [format["Buy %1 for %2€",_dispName, _fuelDrum # 1], {[player, _this # 3 # 0, _this # 3 # 1, [['A3A_fnc_initMovableObject', true], ['A3A_fnc_logistics_addLoadAction', false]]] call A3A_fnc_buyItem},_fuelDrum,0,false,true,"","_this == theBoss",4]; }; if (isClass (configFile/"CfgVehicles"/_fuelTank # 0)) then { private _dispName = getText (configFile/"CfgVehicles"/_fuelTank # 0/"displayName"); - vehicleBox addAction [format["Buy %1 for %2€",_dispName, _fuelTank # 1], {[player, _this # 3 # 0, _this # 3 # 1, [['A3A_fnc_logistics_addLoadAction', false]]] call A3A_fnc_buyItem},_fuelTank,0,false,true,"","true",4]; + vehicleBox addAction [format["Buy %1 for %2€",_dispName, _fuelTank # 1], {[player, _this # 3 # 0, _this # 3 # 1, [['A3A_fnc_initMovableObject', true], ['A3A_fnc_logistics_addLoadAction', false]]] call A3A_fnc_buyItem},_fuelTank,0,false,true,"","_this == theBoss",4]; }; call A3A_fnc_dropObject; diff --git a/A3A/addons/core/functions/init/fn_initZones.sqf b/A3A/addons/core/functions/init/fn_initZones.sqf index 6a5ad46144..d997ae9e3e 100644 --- a/A3A/addons/core/functions/init/fn_initZones.sqf +++ b/A3A/addons/core/functions/init/fn_initZones.sqf @@ -289,10 +289,11 @@ A3A_fuelStations apply { _mrkFinalFuel = createMarker [format ["Ant%1", mapGridPosition _x], position _x]; _mrkFinalFuel setMarkerShape "ICON"; _mrkFinalFuel setMarkerType "loc_Fuelstation"; - _mrkFinalFuel setMarkerColor "ColorPink"; - _mrkFinalFuel setMarkerText "fuel station"; + _mrkFinalFuel setMarkerColor "ColorGrey"; + _mrkFinalFuel setMarkerText "Fuel station"; + _mrkFinalFuel setMarkerAlpha 0.75; if(A3A_hasACE) then { - [_x, 10000] call ace_refuel_fnc_setFuel; // only call on fuels that are not blacklisted and first zone init. + [_x, 250] call ace_refuel_fnc_setFuel; // only call on fuels that are not blacklisted and first zone init. }; }; diff --git a/A3A/addons/maps/Antistasi_cam_lao_nam.cam_lao_nam/mapInfo.hpp b/A3A/addons/maps/Antistasi_cam_lao_nam.cam_lao_nam/mapInfo.hpp index cefa16c916..1478cc1bb2 100644 --- a/A3A/addons/maps/Antistasi_cam_lao_nam.cam_lao_nam/mapInfo.hpp +++ b/A3A/addons/maps/Antistasi_cam_lao_nam.cam_lao_nam/mapInfo.hpp @@ -14,7 +14,7 @@ class cam_lao_nam { {},{"airport_5","outpost_33","outpost_34","resource_4","seaport_3","outpost_15","outpost_22","outpost_8","outpost_4","resource_9","outpost_21","resource_14","outpost_3","outpost_2","factory_3","outpost_1","outpost_7","seaport_2","outpost_32","airport_1","outpost_23","outpost_10","outpost_5","outpost_16","outpost_6","outpost_11","resource_6","resource_20","outpost_9","outpost_38"},{},{"control_1","control_2","control_3","control_4","control_5","control_6","control_7","control_8","control_9","control_10","control_11","control_12","control_13","control_14","control_15","control_16","control_17","control_18","control_19","control_20","control_21","control_22","control_23","control_24","control_25","control_26","control_27","control_28","control_29"} }; fuelStationTypes[] = { - "Land_vn_fuelstation_01_pump_f","Land_vn_fuelstation_02_pump_f","Land_vn_fuelstation_feed_f" + "Land_vn_fuelstation_01_pump_f","Land_vn_fuelstation_02_pump_f","Land_vn_fuelstation_feed_f","Land_vn_usaf_fueltank_75_01" }; climate = "tropical"; };