Advanced Vehicle Repair in SafeZones

This commit is contained in:
He-Man 2019-03-03 02:23:14 +01:00
parent d6267babb1
commit fac47bc492
2 changed files with 5 additions and 2 deletions

View File

@ -7,7 +7,7 @@
5 setvelocity !="setVelocityTarget" !="_bolt setPosATL _pos;\n_bolt setVelocity [0, 0, -10];" !="EPOCH_target setvelocitytransformation" !="_currentTarget setVelocity [0,0,-0.01];" !="_head setVelocity [\n(sin _dir * _speed), \n(cos _dir * _speed)" !="_vel = velocity this; _dir = getDir player; this setVelocity[(_vel select 0)+(sin _dir * 2),(_vel select 1)+(cos _dir * 2),(_vel select 2)];" !="_head setVelocity [random 2,random 2,10];" !="_bobber setVelocity [0,-1,-10];" !="_x setvelocity [0,0,0.1];" !="_veh setVelocity [0,0,0];" !="_this select 0 setvelocity (_this select 1)" !="_zombie setVelocityTransformation [_aslPos,_aslPos,_unitV,_unitV,_unitvDir,_vDir,_unitvUp,_unitvUp,2];" !="_smokeg setVelocity _Gvel;"
5 assignAs !"assignAsCargo" !="_unit assignAsGunner _axeCopter;" !="_driver assignAsDriver _axeCopter;" !="axeVIP assignAsDriver vehicle axeVIP;"
5 assignAsCargo !="_x assignAsCargo axeGeneralsBoat;" !="axeVIP assignAsCargo vehicle player;" !="axeVIP assignAsCargo vehicle axeVIP;"
5 allowDamage !="_unit allowDamage false;" !="_unit allowDamage true;" !="player allowDamage true;" !="vehicle player allowDamage true;" !="player allowDamage false;" !="_target allowDamage true;" !="_cargo allowDamage false;"
5 allowDamage !="_unit allowDamage false;" !="_unit allowDamage true;" !="player allowDamage true;" !="vehicle player allowDamage true;" !="player allowDamage false;" !="_target allowDamage true;" !="_cargo allowDamage false;" !="if (_god) then {_vehicle allowdamage"
5 addWeaponCargo !="_acceptHolder addWeaponCargo [_wWeapon, 1] ;" !="CBA_fnc_addWeaponCargo" !="\\fnc_addWeaponCargo" !="\"addWeaponCargo" !="cba_fAddWeaponCargo"
5 onMapSingleClick !="onMapSingleClick '';" !="\"onmapsingleclick\""
5 addMagazine !"addMagazineCargo" !="player addMagazine [_item,_count];" !="player addMagazine \"sledge_swing\";" !="player addMagazine \"Hatchet_swing\";" !="player addMagazine \"stick_swing\";" !="_wh addMagazineAmmoCargo[_item, 1, _count];" !="CBA_fnc_addMagazine" !="\\fnc_addMagazine" !="\"addMagazine" !="vehicle player addMagazineTurret" !="vehicle player addMagazineTurret" !="EPOCH_fnc_addMagazineOverflow" !="_vehicle addMagazineTurret [_ammotype, _turret, _ammocount]"

View File

@ -13,10 +13,12 @@
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/vehicles/EPOCH_client_repairVehicle.sqf
*/
//[[[cog import generate_private_arrays ]]]
private ["_currentDMG"];
private ["_currentDMG","_god"];
//[[[end]]]
params ["_vehicle","_value"];
if (local _vehicle) then {
_god = !(isDamageAllowed _vehicle);
if (_god) then {_vehicle allowdamage true;};
{
if ((_x select 0) isequaltype 0) then {
_vehicle setHitIndex [_x select 0, _x select 1];
@ -25,6 +27,7 @@ if (local _vehicle) then {
_vehicle setHitPointDamage [_x select 0, _x select 1];
};
} foreach _value;
if (_god) then {_vehicle allowdamage false;};
if !({_x > 0} count ((getAllHitPointsDamage _vehicle) select 2) > 0) then {
[_vehicle,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2];