mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
Merge pull request #723 from Ignatz-HeMan/patch-6
Added optional Classnames for Service Point Pos.
This commit is contained in:
commit
2950f77d4b
@ -1,14 +1,48 @@
|
||||
if (vehicle player == player) exitwith {false};
|
||||
if !(local vehicle player) exitwith {false};
|
||||
if (speed vehicle player > 2 || speed vehicle player < -2) exitwith {false};
|
||||
if (((getpos vehicle player) select 2) > 1) exitwith {false};
|
||||
/*
|
||||
Author: [Ignatz] He-Man
|
||||
|
||||
Contributors: Aaron Clark - EpochMod.com
|
||||
|
||||
Description:
|
||||
Check if in Service Point for A3 Epoch
|
||||
|
||||
Licence:
|
||||
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
||||
|
||||
Github:
|
||||
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/servicepoint/EPOCH_SP_Check.sqf
|
||||
*/
|
||||
|
||||
private ['_inSP','_vehicle','_vehName','_allRepaired'];
|
||||
|
||||
_vehicle = vehicle player;
|
||||
if (_vehicle == player) exitwith {false};
|
||||
if !(local _vehicle) exitwith {false};
|
||||
if (speed _vehicle > 2 || speed _vehicle < -2) exitwith {false};
|
||||
if (((getpos _vehicle) select 2) > 1) exitwith {false};
|
||||
if (!(_vehicle iskindof 'ship') && (((getposasl _vehicle) select 2) < 1)) exitwith {false};
|
||||
|
||||
_config = 'CfgServicePoint' call EPOCH_returnConfig;
|
||||
_servicepoints = getArray (_config >> worldname >> 'ServicePoints');
|
||||
_servicepointDist = ["CfgServicePoint", "ServicePointDist", 40] call EPOCH_fnc_returnConfigEntryV2;
|
||||
_ServicePointClasses = ["CfgServicePoint", "ServicePointClasses", []] call EPOCH_fnc_returnConfigEntryV2;
|
||||
|
||||
if (_servicepoints isequalto []) exitwith {false};
|
||||
if !(({player distance _x < _servicepointDist} count _servicepoints > 0)) exitwith {false};
|
||||
_Vehicle = vehicle player;
|
||||
if (!(_Vehicle iskindof 'ship') && (((getposasl _Vehicle) select 2) < 1)) exitwith {false};
|
||||
true
|
||||
if (_servicepoints isequalto [] && _ServicePointClasses isequalto []) exitwith {false};
|
||||
if (_vehicle == player) exitwith {false};
|
||||
if !(local _vehicle) exitwith {false};
|
||||
if (speed _vehicle > 2 || speed _vehicle < -2) exitwith {false};
|
||||
if (((getpos _vehicle) select 2) > 1) exitwith {false};
|
||||
if (!(_vehicle iskindof 'ship') && (((getposasl _vehicle) select 2) < 1)) exitwith {false};
|
||||
_inSP = false;
|
||||
if (({player distance _x < _servicepointDist} count _servicepoints > 0)) then {
|
||||
_inSP = true;
|
||||
};
|
||||
if (!_inSP) then {
|
||||
if !(_ServicePointClasses isequalto []) then {
|
||||
_nearClasses = nearestobjects [_vehicle,_ServicePointClasses,_servicepointDist];
|
||||
if !(_nearClasses isequalto []) then {
|
||||
_inSP = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
_inSP
|
||||
|
@ -1,20 +1,31 @@
|
||||
params ['_vehicle','_ammotype','_turret','_reloagmags','_ammocount','_costs'];
|
||||
private ['_magname'];
|
||||
_vehtype = typeof _vehicle;
|
||||
_VehName = getText(configFile >> 'cfgVehicles' >> _vehtype >> 'displayName');
|
||||
if (!local _vehicle) exitWith {
|
||||
_line = 'Rearm denied - Vehicle is not local to you!';
|
||||
[_line,5] call Epoch_message;
|
||||
};
|
||||
if(count (crew _vehicle) > 1) exitWith {
|
||||
_line = 'Rearm denied - All Passengers must exit the Vehicle!';
|
||||
[_line,5] call Epoch_message;
|
||||
};
|
||||
if (EPOCH_playerCrypto < _costs) exitWith {
|
||||
_line = format ['You need %1 Crypto to re-arm %2', _costs,_VehName];
|
||||
[_line,5] call Epoch_message;
|
||||
};
|
||||
/*
|
||||
Author: [Ignatz] He-Man
|
||||
|
||||
Contributors: Aaron Clark - EpochMod.com
|
||||
|
||||
Description:
|
||||
Rearm Vehicles for A3 Epoch
|
||||
|
||||
Licence:
|
||||
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
||||
|
||||
Github:
|
||||
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/servicepoint/EPOCH_SP_Rearm.sqf
|
||||
*/
|
||||
|
||||
private ['_magname','_vehtype','_vehName'];
|
||||
params ['_vehicle','_ammotype','_turret','_reloagmags','_ammocount','_costs'];
|
||||
|
||||
if (!local _vehicle) exitWith {
|
||||
_line = 'Rearm denied - Go in as driver first!';
|
||||
[_line,5] call Epoch_message;
|
||||
};
|
||||
_vehtype = typeof _vehicle;
|
||||
_vehName = getText(configFile >> 'cfgVehicles' >> _vehtype >> 'displayName');
|
||||
if (EPOCH_playerCrypto < _costs) exitWith {
|
||||
_line = format ['You need %1 Crypto to Rearm %2', _costs,_vehName];
|
||||
[_line,5] call Epoch_message;
|
||||
};
|
||||
if(_costs > 0)then{
|
||||
[player,(_costs*-1),Epoch_personalToken] remoteexec ['epoch_server_paycrypto',2];
|
||||
};
|
||||
@ -26,5 +37,5 @@ _magname = getText (configFile >> 'CfgMagazines' >> _ammotype >> 'displayName');
|
||||
if (_magname isequalto '') then {
|
||||
_magname = _ammotype;
|
||||
};
|
||||
_line = format ['%1 rearmed with %2', _VehName, _magname];
|
||||
_line = format ['%1 rearmed with %2', _vehName, _magname];
|
||||
[_line,5] call Epoch_message;
|
||||
|
@ -1,32 +1,44 @@
|
||||
private ['_vehicle','_args','_servicePoint','_costs','_updateInterval','_amount','_type','_name','_textMissing'];
|
||||
_vehicle = _this select 0;
|
||||
if (!local _vehicle) exitWith {};
|
||||
_args = _this select 1;
|
||||
_costs = _args select 0;
|
||||
_updateInterval = _args select 1;
|
||||
_amount = _args select 2;
|
||||
_type = typeOf _vehicle;
|
||||
_name = getText(configFile >> 'cfgVehicles' >> _type >> 'displayName');
|
||||
/*
|
||||
Author: [Ignatz] He-Man
|
||||
|
||||
Contributors: Aaron Clark - EpochMod.com
|
||||
|
||||
Description:
|
||||
Refuel Vehicles for A3 Epoch
|
||||
|
||||
Licence:
|
||||
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
||||
|
||||
Github:
|
||||
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/servicepoint/EPOCH_SP_Refuel.sqf
|
||||
*/
|
||||
|
||||
private ['_vehtype','_vehName'];
|
||||
params [['_vehicle',objnull],['_args',[]]];
|
||||
_args params [['_costs',0],['_updateInterval',1],['_amount',0.1]];
|
||||
|
||||
if (!local _vehicle) exitWith {
|
||||
_line = 'Refuel denied - Go in as driver first!';
|
||||
[_line,5] call Epoch_message;
|
||||
};
|
||||
_vehtype = typeof _vehicle;
|
||||
_vehName = getText(configFile >> 'cfgVehicles' >> _vehtype >> 'displayName');
|
||||
if (EPOCH_playerCrypto < _costs) exitWith {
|
||||
_line = format ['You need %1 Crypto to refuel %2', _costs,_name];
|
||||
_line = format ['You need %1 Crypto to Refuel %2', _costs,_vehName];
|
||||
[_line,5] call Epoch_message;
|
||||
};
|
||||
if(_costs > 0)then{
|
||||
[player,(_costs*-1),Epoch_personalToken] remoteexec ['epoch_server_paycrypto',2];
|
||||
};
|
||||
_vehicle engineOn false;
|
||||
if ((vehicle player != _vehicle) || (!local _vehicle) || speed _vehicle < -2 || speed _vehicle > 2) exitWith {
|
||||
_line = format ['Fueling of %1 stopped', _name];
|
||||
[_line,5] call Epoch_message;
|
||||
};
|
||||
while {(vehicle player == _vehicle) && (local _vehicle)} do {
|
||||
while {(vehicle player == _vehicle) && (local _vehicle) && (alive player)} do {
|
||||
if (speed _vehicle > 2 || speed _vehicle < -2 ) exitWith {
|
||||
_line = format ['Refueling of %1 stopped', _name];
|
||||
_line = format ['Refueling of %1 stopped', _vehName];
|
||||
[_line,5] call Epoch_message;
|
||||
};
|
||||
_vehicle setFuel ((Fuel _vehicle)+_amount);
|
||||
if (Fuel _vehicle > 0.99) exitWith {
|
||||
_line = format ['%1 Refueled', _name];
|
||||
_line = format ['%1 Refueled', _vehName];
|
||||
[_line,5] call Epoch_message;
|
||||
};
|
||||
uisleep _updateInterval;
|
||||
|
@ -1,28 +1,43 @@
|
||||
private ['_Ignatz_vehicle','_args','_servicePoint','_costs','_repairTime','_type','_name','_hitpoints','_allRepaired'];
|
||||
_Ignatz_vehicle = _this select 0;
|
||||
if (!local _Ignatz_vehicle) exitWith {
|
||||
diag_log format['Error: called service_point_repair.sqf with non-local vehicle: %1', _Ignatz_vehicle]
|
||||
/*
|
||||
Author: [Ignatz] He-Man
|
||||
|
||||
Contributors: Aaron Clark - EpochMod.com
|
||||
|
||||
Description:
|
||||
Repair Vehicles for A3 Epoch
|
||||
|
||||
Licence:
|
||||
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
||||
|
||||
Github:
|
||||
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/servicepoint/EPOCH_SP_Repair.sqf
|
||||
*/
|
||||
|
||||
private ['_vehtype','_vehName','_allRepaired'];
|
||||
params [['_vehicle',objnull],['_args',[]]];
|
||||
_args params [['_costs',0],['_updateInterval',1.2]];
|
||||
|
||||
if (!local _vehicle) exitWith {
|
||||
_line = 'Repair denied - Go in as driver first!';
|
||||
[_line,5] call Epoch_message;
|
||||
};
|
||||
_args = _this select 1;
|
||||
_costs = _args select 0;
|
||||
_repairTime = _args select 1;
|
||||
_type = typeOf _Ignatz_vehicle;
|
||||
_name = getText(configFile >> 'cfgVehicles' >> _type >> 'displayName');
|
||||
_vehtype = typeOf _vehicle;
|
||||
_vehName = getText(configFile >> 'cfgVehicles' >> _vehtype >> 'displayName');
|
||||
if (EPOCH_playerCrypto < _costs) exitWith {
|
||||
_line = format ['You need %1 Crypto to Repair %2', _costs,_name];
|
||||
_line = format ['You need %1 Crypto to Repair %2', _costs,_vehName];
|
||||
[_line,5] call Epoch_message;
|
||||
};
|
||||
if(_costs > 0)then{
|
||||
[player,(_costs*-1),Epoch_personalToken] remoteexec ['epoch_server_paycrypto',2];
|
||||
};
|
||||
_Ignatz_vehicle engineOn false;
|
||||
_vehicle engineOn false;
|
||||
_repaired = [];
|
||||
_allRepaired = true;
|
||||
_allHitPointsDamage = getAllHitPointsDamage _Ignatz_vehicle;
|
||||
_allHitPointsDamage = getAllHitPointsDamage _vehicle;
|
||||
{
|
||||
if ((vehicle player != _Ignatz_vehicle) || (!local _Ignatz_vehicle) || speed _Ignatz_vehicle < -2 || speed _Ignatz_vehicle > 2) exitWith {
|
||||
if ((vehicle player != _vehicle) || (!local _vehicle) || speed _vehicle < -2 || speed _vehicle > 2) exitWith {
|
||||
_allRepaired = false;
|
||||
_line = format ['Repairing of %1 stopped', _name];
|
||||
_line = format ['Repairing of %1 stopped', _vehName];
|
||||
[_line,5] call Epoch_message;
|
||||
};
|
||||
if (!(_x in _repaired) && !(_x isequalto "") && (_allHitPointsDamage select 2 select _foreachindex) > 0) then {
|
||||
@ -31,20 +46,20 @@ _allHitPointsDamage = getAllHitPointsDamage _Ignatz_vehicle;
|
||||
_partName set [1,45];
|
||||
_partName set [2,20];
|
||||
_partName = toString _partName;
|
||||
_Ignatz_vehicle setHitPointDamage [_x,0];
|
||||
_vehicle setHitPointDamage [_x,0];
|
||||
_line = format ['Repairing%1 ...', _partName];
|
||||
[_line,5] call Epoch_message;
|
||||
_repaired pushback _x;
|
||||
uisleep _repairTime;
|
||||
uisleep _updateInterval;
|
||||
};
|
||||
} foreach (_allHitPointsDamage select 0);
|
||||
if (_allRepaired) then {
|
||||
if ((damage _Ignatz_vehicle) > 0) then {
|
||||
[_Ignatz_vehicle,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2];
|
||||
if ((damage _vehicle) > 0) then {
|
||||
[_vehicle,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2];
|
||||
};
|
||||
_pos = getposatl _Ignatz_vehicle;
|
||||
_pos = getposatl _vehicle;
|
||||
_pos set [2,(_pos select 2)+0.25];
|
||||
_Ignatz_vehicle setposatl _pos;
|
||||
_line = format ['%1 full Repaired', _name];
|
||||
_vehicle setposatl _pos;
|
||||
_line = format ['%1 full Repaired', _vehName];
|
||||
[_line,5] call Epoch_message;
|
||||
};
|
||||
|
@ -1,3 +1,20 @@
|
||||
/*
|
||||
Author: [Ignatz] He-Man
|
||||
|
||||
Contributors: Aaron Clark - EpochMod.com
|
||||
|
||||
Description:
|
||||
Service Point StartScript for A3 Epoch
|
||||
|
||||
Licence:
|
||||
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
||||
|
||||
Github:
|
||||
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/servicepoint/EPOCH_SP_Start.sqf
|
||||
*/
|
||||
|
||||
private ['_missingammo','_ownedcompletemags','_magname','_actionTitle','_costs','_vehicle','_refuel_costs','_refuel_updateInterval','_refuel_amount','_costsFree','_repair_costs','_fnc_getCosts','_fnc_actionTitle'];
|
||||
|
||||
Ignatz_Refuel = nil;
|
||||
Ignatz_Repair = nil;
|
||||
Ignatz_Rearm0 = nil;
|
||||
@ -5,21 +22,7 @@ Ignatz_Rearm1 = nil;
|
||||
Ignatz_Rearm2 = nil;
|
||||
Ignatz_Rearm3 = nil;
|
||||
|
||||
if (vehicle player == player) exitwith {false};
|
||||
if !(local vehicle player) exitwith {false};
|
||||
if (speed vehicle player > 2 || speed vehicle player < -2) exitwith {false};
|
||||
if (((getpos vehicle player) select 2) > 1) exitwith {false};
|
||||
|
||||
private ['_missingammo','_ownedcompletemags','_magname','_actionTitle','_costs','_vehicle','_refuel_costs','_refuel_updateInterval','_refuel_amount','_costsFree','_repair_costs','_repair_repairTime','_fnc_getCosts','_fnc_actionTitle'];
|
||||
|
||||
_config = 'CfgServicePoint' call EPOCH_returnConfig;
|
||||
_servicepoints = getArray (_config >> worldname >> 'ServicePoints');
|
||||
_servicepointDist = ["CfgServicePoint", "ServicePointDist", 40] call EPOCH_fnc_returnConfigEntryV2;
|
||||
|
||||
if !(({player distance _x < _servicepointDist} count _servicepoints > 0)) exitwith {false};
|
||||
_Vehicle = vehicle player;
|
||||
if (!(_Vehicle iskindof 'ship') && (((getposasl _Vehicle) select 2) < 1)) exitwith {false};
|
||||
|
||||
_vehicle = vehicle player;
|
||||
_repair_costs = ["CfgServicePoint", "repair_costs", []] call EPOCH_fnc_returnConfigEntryV2;
|
||||
_refuel_costs = ["CfgServicePoint", "refuel_costs", []] call EPOCH_fnc_returnConfigEntryV2;
|
||||
_refuel_updateInterval = ["CfgServicePoint", "refuel_updateInterval", 1] call EPOCH_fnc_returnConfigEntryV2;
|
||||
@ -43,6 +46,7 @@ _fnc_getCosts = {
|
||||
} forEach _costs;
|
||||
_cost
|
||||
};
|
||||
|
||||
_fnc_actionTitle = {
|
||||
private ['_itemName','_displayName','_actionName','_costs','_costsText','_actionTitle'];
|
||||
_actionName = _this select 0;
|
||||
|
@ -1,11 +1,11 @@
|
||||
class CfgServicePoint {
|
||||
class Altis {
|
||||
ServicePoints[] = {
|
||||
ServicePoints[] = { // Array of coords for ServicePoints
|
||||
{13325,14477,0}
|
||||
};
|
||||
};
|
||||
class Tanoa {
|
||||
ServicePoints[] = {
|
||||
ServicePoints[] = { // Array of coords for ServicePoints
|
||||
/*
|
||||
{2157.79,3477.65,0},
|
||||
{11731.5,3125.95,0},
|
||||
@ -19,11 +19,17 @@ class CfgServicePoint {
|
||||
*/
|
||||
};
|
||||
};
|
||||
class Chernarus {
|
||||
class Chernarus { // Array of coords for ServicePoints
|
||||
ServicePoints[] = {
|
||||
|
||||
};
|
||||
};
|
||||
ServicePointClasses[] = { // Array of Classnames, where also are ServicePoints
|
||||
// "Land_Pillar_Pier_F",
|
||||
// "Land_CarService_F",
|
||||
// "Land_fs_feed_F",
|
||||
// "Land_fs_roof_F"
|
||||
};
|
||||
ServicePointDist = 40;
|
||||
refuel_updateInterval = 1;
|
||||
refuel_amount = 0.1;
|
||||
@ -245,4 +251,4 @@ class CfgServicePoint {
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user