2015-03-10 18:55:56 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
["setVehicleDamage", {_this call FUNC(setDamage)}] call EFUNC(common,addEventHandler);
|
|
|
|
["setVehicleHitPointDamage", {_this call FUNC(setHitPointDamage)}] call EFUNC(common,addEventHandler);
|
2015-03-29 01:35:55 +00:00
|
|
|
|
|
|
|
// wheels
|
|
|
|
["setWheelHitPointDamage", {(_this select 0) setHitPointDamage [_this select 1, _this select 2]}] call EFUNC(common,addEventHandler);
|
2015-08-18 21:41:25 +00:00
|
|
|
|
|
|
|
if (isServer) then {
|
|
|
|
["SettingsInitialized", {
|
|
|
|
GVAR(settingInitted) = true; // Stop collecting in FUNC(addSpareParts)
|
|
|
|
|
2015-08-26 21:43:06 +00:00
|
|
|
// Exit if adding spare parts disabled and clean collection
|
2015-08-18 21:41:25 +00:00
|
|
|
if (!GVAR(addSpareParts)) exitWith {GVAR(addSparePartsCollection) = nil};
|
|
|
|
|
|
|
|
// Add spare parts to vehicles in collection
|
|
|
|
{
|
|
|
|
[_x] call FUNC(addSpareParts);
|
|
|
|
} forEach GVAR(addSparePartsCollection);
|
2015-08-26 21:43:06 +00:00
|
|
|
|
|
|
|
// Clean collection
|
|
|
|
GVAR(addSparePartsCollection) = nil;
|
2015-08-18 21:41:25 +00:00
|
|
|
}] call EFUNC(common,addEventHandler);
|
|
|
|
};
|