From 1bdbda8794ee189148885b37ddf53871d824ad1c Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Mon, 2 Sep 2013 20:58:21 +0100 Subject: [PATCH] Update fn_lightFunctions.sqf Add missing function DZE_getModelName. --- SQF/dayz_code/compile/fn_lightFunctions.sqf | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/SQF/dayz_code/compile/fn_lightFunctions.sqf b/SQF/dayz_code/compile/fn_lightFunctions.sqf index 0d6e30ccd..5003c997b 100644 --- a/SQF/dayz_code/compile/fn_lightFunctions.sqf +++ b/SQF/dayz_code/compile/fn_lightFunctions.sqf @@ -82,3 +82,20 @@ _nrTLs= position _twr nearObjects ["#lightpoint",30]; }; }; }; +DZE_getModelName = { + _objInfo = toArray(str(_this)); + _lenInfo = count _objInfo - 1; + _objName = []; + _i = 0; + // determine where the object name starts + { + if (58 == _objInfo select _i) exitWith {}; + _i = _i + 1; + } forEach _objInfo; + _i = _i + 2; // skip the ": " part + for "_k" from _i to _lenInfo do { + _objName = _objName + [_objInfo select _k]; + }; + _objName = toLower(toString(_objName)); + _objName +};