forked from specop0/arma_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdestroyUnits.sqf
More file actions
37 lines (32 loc) · 1.13 KB
/
destroyUnits.sqf
File metadata and controls
37 lines (32 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
Author: SpecOp0
Description:
Destroys units (Man and LandVehicle) around given marker with given radius.
Sleeps between each valid unit 1 second.
Parameter(s):
0: STRING - marker name
1: NUMBER - radius to destroy units
Returns:
true
Usage (Trigger.OnActivation):
["target1", 500] call compile preprocessFileLineNumbers "destroyUnits.sqf";
*/
if(isServer) then {
private _scriptHanddle = _this spawn {
params [ ["_markerName","",[""]], ["_radius",0,[0]] ];
private _markerPos = getMarkerPos _markerName;
if(_markerPos select 0 != 0 && _markerPos select 1 != 0) then {
private _objectList = nearestObjects [_markerPos, ["LandVehicle","Man"], _radius];
{
if(!isNull _x && {!isPlayer _x && getDammage _x != 1}) then {
_x allowDamage true;
_x setDamage 1;
sleep 1;
};
} forEach _objectList;
} else {
["Wrong Parameter: Marker %1 does not exist (or has x- and y-coordinate 0).", _markerName] call BIS_fnc_error;
};
};
};
true