mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
Added optional Classnames for Service Point Pos.
- Added optional Classnames for Service Point Pos - Some Cleanups and Script optimization
This commit is contained in:
parent
cf27001966
commit
a5a51a9ac6
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user