武装突袭3

武装突袭3

ScriptMenu
 此主题已被置顶,因此可能具有重要性
[PBS] YOLO42  [开发者] 12 月 8 日 上午 12:53
Cool Scripts
Post your favourite scripts here.
最后由 [PBS] YOLO42 编辑于; 12 月 8 日 上午 12:54
< >
正在显示第 1 - 3 条,共 3 条留言
[PBS] YOLO42  [开发者] 12 月 8 日 上午 1:16 
Friendly Fire Off script, because the biggest danger is getting fragged by your own squad.
private _caller = player; if (isNil "friendlyFireEnabled") then {friendlyFireEnabled = false}; if (!friendlyFireEnabled) then { { _x setVariable ["ffHandler", _x addEventHandler ["HandleDamage", { params ["_unit", "", "_damage", "_source"]; if (!isNull _source && {side _source == side _unit && _source != _unit}) then { 0 } else { _damage }; }]]; } forEach units group _caller; friendlyFireEnabled = true; hint "Friendly Fire: OFF"; } else { { private _unit = _x; private _handlerId = _unit getVariable ["ffHandler", -1]; if (_handlerId != -1) then { _unit removeEventHandler ["HandleDamage", _handlerId]; _unit setVariable ["ffHandler", nil]; }; } forEach units group _caller; friendlyFireEnabled = false; hint "Friendly Fire: ON"; };
最后由 [PBS] YOLO42 编辑于; 12 月 8 日 上午 1:17
[PBS] YOLO42  [开发者] 12 月 8 日 上午 5:04 
Scripts to divide squad into 2 and 3 teams respectively.
private _selectedUnits = (units group player) - [player]; if (count _selectedUnits == 0) then {_selectedUnits = (units group player) - [player]}; if (count _selectedUnits == 0) exitWith {hint "No units to command"}; private _halfCount = ceil ((count _selectedUnits) / 2); for "_i" from 0 to (_halfCount - 1) do { if (_i < count _selectedUnits) then { (_selectedUnits select _i) assignTeam "RED"; }; }; for "_i" from _halfCount to ((count _selectedUnits) - 1) do { (_selectedUnits select _i) assignTeam "GREEN"; }; hint format ["Divided %1 units: %2 RED, %3 GREEN", count _selectedUnits, _halfCount, (count _selectedUnits) - _halfCount];


private _selectedUnits = (units group player) - [player]; if (count _selectedUnits == 0) then {_selectedUnits = (units group player) - [player]}; if (count _selectedUnits == 0) exitWith {hint "No units to command"}; private _unitCount = count _selectedUnits; private _redCount = ceil (_unitCount / 3); private _greenCount = ceil ((_unitCount - _redCount) / 2); private _blueCount = _unitCount - _redCount - _greenCount; for "_i" from 0 to (_redCount - 1) do { if (_i < _unitCount) then { (_selectedUnits select _i) assignTeam "RED"; }; }; for "_i" from _redCount to (_redCount + _greenCount - 1) do { if (_i < _unitCount) then { (_selectedUnits select _i) assignTeam "GREEN"; }; }; for "_i" from (_redCount + _greenCount) to (_unitCount - 1) do { (_selectedUnits select _i) assignTeam "BLUE"; }; hint format ["Divided %1 units: %2 RED, %3 GREEN, %4 BLUE", _unitCount, _redCount, _greenCount, _blueCount];
最后由 [PBS] YOLO42 编辑于; 12 月 8 日 下午 12:29
[PBS] YOLO42  [开发者] 12 月 8 日 上午 5:04 
Script to garrison your squad inside a building.
private _selectedUnits = (units group player) - [player]; if (count _selectedUnits == 0) then {_selectedUnits = (units group player) - [player]}; if (count _selectedUnits == 0) exitWith {hint "No units to command"}; private _aimPos = screenToWorld [0.5, 0.5]; private _building = nearestBuilding _aimPos; private _buildingPositions = _building buildingPos -1; if (count _buildingPositions == 0) exitWith {hint "No garrison positions available"}; private _lastBuilding = missionNamespace getVariable ["GARRISON_lastBuilding", objNull]; private _lastTime = missionNamespace getVariable ["GARRISON_lastTime", 0]; private _currentTime = time; private _usePathfinding = true; if (_building == _lastBuilding && (_currentTime - _lastTime) < 120) then {_usePathfinding = false}; missionNamespace setVariable ["GARRISON_lastBuilding", _building]; missionNamespace setVariable ["GARRISON_lastTime", _currentTime]; private _buildingCenter = getPos _building; { private _unit = _x; private _posIndex = _forEachIndex min ((count _buildingPositions) - 1); private _pos = _buildingPositions select _posIndex; private _dirToOutward = _buildingCenter getDir _pos; if (_usePathfinding) then { _unit doMove _pos; [_unit, _pos, _dirToOutward] spawn { params ["_unit", "_targetPos", "_dir"]; waitUntil {sleep 0.5; (_unit distance _targetPos < 2) || !alive _unit}; if (alive _unit) then { _unit setUnitPos "MIDDLE"; _unit setDir _dir; doStop _unit; }; }; } else { _unit setPosATL _pos; _unit setUnitPos "MIDDLE"; _unit setDir _dirToOutward; doStop _unit; }; } forEach _selectedUnits; hint format ["Garrisoning %1 units", count _selectedUnits min count _buildingPositions];
最后由 [PBS] YOLO42 编辑于; 12 月 8 日 上午 5:06
< >
正在显示第 1 - 3 条,共 3 条留言
每页显示数: 1530 50