diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:38:09 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:38:09 +0300 |
| commit | a3a91d4f45b22fd487ecbc954ad979be5d03efdd (patch) | |
| tree | a554ab159a347dcd6c00ca1c7c26c1ec3ac0a6bd /Server/AI/Orders/AI_WPAdd.sqf | |
| download | a2wf_chernarus-a3a91d4f45b22fd487ecbc954ad979be5d03efdd.tar.gz a2wf_chernarus-a3a91d4f45b22fd487ecbc954ad979be5d03efdd.tar.bz2 a2wf_chernarus-a3a91d4f45b22fd487ecbc954ad979be5d03efdd.zip | |
Diffstat (limited to '')
| -rw-r--r-- | Server/AI/Orders/AI_WPAdd.sqf | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Server/AI/Orders/AI_WPAdd.sqf b/Server/AI/Orders/AI_WPAdd.sqf new file mode 100644 index 0000000..ad04518 --- /dev/null +++ b/Server/AI/Orders/AI_WPAdd.sqf @@ -0,0 +1,39 @@ +/*
+ Author: Benny
+ Name: AI_WPAdd.sqf
+ Parameters:
+ 0 - Team
+ 1 - Clear (Remove WPs)
+ 2 - Waypoints (given in an Array)
+ Description:
+ This file is used to give a detailed WP system.
+ Exemple:
+ [_team, true, [[getPos _camp, 'MOVE', 10, 20, "", []],[[1560,2560,0], 'SAD', 50, 70, "", ["canComplete", "this sidechat 'lets roll'"]]...]] Call AddWP;
+*/
+
+Private ['_clear','_completionRadius','_position','_radius','_scripted','_statements','_team','_type','_waypoint','_waypoints','_WPCount'];
+_team = _this select 0;
+_clear = _this select 1;
+_waypoints = _this select 2;
+
+if (_clear) then {_team Call AIWPRemove};
+
+{
+ _position = _x select 0;
+ _type = _x select 1;
+ _radius = _x select 2;
+ _completionRadius = _x select 3;
+ _scripted = _x select 4;
+ _statements = _x select 5;
+ if (typeName _position == 'OBJECT') then {_position = getPos _position};
+
+ _WPCount = count (waypoints _team);
+
+ _team addWaypoint [_position,_radius];
+ [_team, _WPCount] setWaypointType _type;
+ [_team, _WPCount] setWaypointCompletionRadius _completionRadius;
+ if (_type == 'SCRIPTED') then {[_team, _WPCount] setWaypointScript _scripted};
+ if (count _statements > 0) then {[_team, _WPCount] setWaypointStatements [_statements select 0, _statements select 1]};
+
+ if (_WPCount == 0) then {_team setCurrentWaypoint [_team, _WPCount]};
+} forEach _waypoints;
\ No newline at end of file |
