Add files via upload

New functions.
This commit is contained in:
worldwidesorrow
2020-07-14 15:58:04 -05:00
committed by GitHub
parent 7fe7f3fcd8
commit 01c2c3eba2
2 changed files with 121 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
/*
Description: Removes the desired element from an array regardless of data type.
Usage: array = [array, index] call fnc_deleteAt;
Made for DayZ Epoch by JasonTM
*/
private ["_arr","_idx","_cnt"];
_arr = _this select 0;
_idx = _this select 1;
_cnt = (count _arr) - 1;
if (_idx > _cnt || {_idx < 0}) exitWith {
diag_log "[fnc_deleteAt] Error: out of bounds index provided!";
_arr
};
for "_i" from _idx to _cnt do {
_arr set [_i, (_arr select (_i + 1))];
};
_arr resize _cnt;
_arr