Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // getNearestObject
- private ["_pos", "_str", "_rad", "_syn", "_merg", "_obj"];
- _pos = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
- _str = [_this, 1, objNull, [objNull]] call BIS_fnc_param;
- _rad = [_this, 2, objNull, [objNull]] call BIS_fnc_param;
- _syn = [_str] call JSC_fnc_getSynObjects;
- _merg = [];
- {
- _z = _x;
- _objs = nearestObjects [_pos, _z, _rad];
- {
- _merg = _marg append [_x];
- } forEach _z;
- } forEach _syn;
- if((count _merg) < 1) exitWith {};
- _obj = (_merg select 0);
- {
- if(((getPos _obj) distanceSqr _pos) > ((getPos _x) distanceSqr _pos)) then
- {
- _obj = _x;
- };
- } forEach _merg;
- return _x;
- // getNearestObjects
- private ["_pos", "_str", "_rad", "_syn", "_merg", "_obj"];
- _pos = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
- _str = [_this, 1, objNull, [objNull]] call BIS_fnc_param;
- _rad = [_this, 2, objNull, [objNull]] call BIS_fnc_param;
- _syn = [_str] call JSC_fnc_getSynObjects;
- _merg = [];
- {
- _z = _x;
- _objs = nearestObjects [_pos, _z, _rad];
- {
- _merg = _merg append [_x];
- } forEach _z;
- } forEach _syn;
- return _merg;
- // callRearm
- private ["_obj", "_type", "_tur", "_mag"];
- _obj = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
- _type = typeOf _obj;
- _obj vehicleChat "Service: Rearming ...";
- _mag = getArray(configFile >> "CfgVehicles" >> _type >> "magazines");
- _tur = getArray(configFile >> "CfgVehicles" >> _type >> "turrets");
- {
- _mt = _x;
- for "_i" from -1 to ((count _tur) - 1) do
- {
- _obj removeMagazinesTurret [_mt, [_i]];
- };
- } forEach _mag;
- if ((count _mag) > 0)
- {
- {
- _obj vehicleChat format ["Service: Rearming %1", _x];
- sleep 1;
- _obj addMagazine _x;
- } forEach _mag;
- };
- _obj vehicleChat "Service: Full Rearmed (100%)";
Advertisement
Add Comment
Please, Sign In to add comment