summaryrefslogtreecommitdiffstats
path: root/Common/Functions/Common_GetAIDigit.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:38:09 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:38:09 +0300
commita3a91d4f45b22fd487ecbc954ad979be5d03efdd (patch)
treea554ab159a347dcd6c00ca1c7c26c1ec3ac0a6bd /Common/Functions/Common_GetAIDigit.sqf
downloada2wf_chernarus-main.tar.gz
a2wf_chernarus-main.tar.bz2
a2wf_chernarus-main.zip
Diffstat (limited to '')
-rw-r--r--Common/Functions/Common_GetAIDigit.sqf21
1 files changed, 21 insertions, 0 deletions
diff --git a/Common/Functions/Common_GetAIDigit.sqf b/Common/Functions/Common_GetAIDigit.sqf
new file mode 100644
index 0000000..935b372
--- /dev/null
+++ b/Common/Functions/Common_GetAIDigit.sqf
@@ -0,0 +1,21 @@
+Private ["_i","_split","_unit","_yield"];
+
+_unit = _this;
+
+if (_unit == leader (group _unit)) exitWith {"Leader"};
+
+_split = toArray(str _unit);
+
+_find = _split find 58;
+_yield = [];
+
+if (_find != -1) then {
+ for '_i' from (_find+1) to count(_split)-1 do {
+ if ((_split select _i) == 65 || (_split select _i) == 32) exitWith {};
+ _yield = _yield + [_split select _i];
+ };
+};
+
+if (count _yield == 0) exitWith {"0"};
+
+toString(_yield) \ No newline at end of file