diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:55:41 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:55:41 +0300 |
| commit | dee52083d359434fc3ac51a871c1b836d092d2ac (patch) | |
| tree | 89bbb6326348a99bcf4a68761bd0c9628b80d4bb /Server/Functions/Server_CreateDefenseTemplate.sqf | |
| download | a2wf_lingor-dee52083d359434fc3ac51a871c1b836d092d2ac.tar.gz a2wf_lingor-dee52083d359434fc3ac51a871c1b836d092d2ac.tar.bz2 a2wf_lingor-dee52083d359434fc3ac51a871c1b836d092d2ac.zip | |
init
Diffstat (limited to '')
| -rw-r--r-- | Server/Functions/Server_CreateDefenseTemplate.sqf | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Server/Functions/Server_CreateDefenseTemplate.sqf b/Server/Functions/Server_CreateDefenseTemplate.sqf new file mode 100644 index 0000000..ae00769 --- /dev/null +++ b/Server/Functions/Server_CreateDefenseTemplate.sqf @@ -0,0 +1,36 @@ +Private ["_created","_current","_dir","_i","_object","_origin","_relDir","_relPos","_skip","_template","_toplace","_toWorld"];
+_origin = _this select 0;
+_template = _this select 1;
+_existingTemplate = if (count _this > 2) then {_this select 2} else {[]};
+
+_dir = getDir _origin;
+_created = [];
+_toplace = objNull;
+
+for '_i' from 0 to count(_template)-1 do {
+ _current = _template select _i;
+ _object = _current select 0;
+ _relPos = _current select 1;
+ _relDir = _current select 2;
+
+ _skip = false;
+ if (_i < count(_existingTemplate)) then {
+ if (alive(_existingTemplate select _i)) then {_skip = true};
+ };
+
+ if !(_skip) then {
+ _toplace = _object createVehicle [0,0,0];
+
+ _toWorld = _origin modelToWorld _relPos;
+ _toWorld set [2,0];
+
+ _toplace setDir (_dir - _relDir);
+ _toplace setPos _toWorld;
+ } else {
+ _toplace = _existingTemplate select _i;
+ };
+
+ _created = _created + [_toplace];
+};
+
+_created
\ No newline at end of file |
