2017-03-26 18:15:24 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
if(_costs > 0)then{
|
2017-03-30 16:02:15 +00:00
|
|
|
[player,(_costs*-1),Epoch_personalToken] remoteexec ['epoch_server_paycrypto',2];
|
2017-03-26 18:15:24 +00:00
|
|
|
};
|
|
|
|
_vehicle removeMagazinesTurret [_ammotype,_turret];
|
|
|
|
for '_i' from 1 to _reloagmags do {
|
|
|
|
_vehicle addMagazineTurret [_ammotype, _turret, _ammocount];
|
|
|
|
};
|
|
|
|
_magname = getText (configFile >> 'CfgMagazines' >> _ammotype >> 'displayName');
|
|
|
|
if (_magname isequalto '') then {
|
|
|
|
_magname = _ammotype;
|
|
|
|
};
|
|
|
|
_line = format ['%1 rearmed with %2', _VehName, _magname];
|
|
|
|
[_line,5] call Epoch_message;
|