Add global fnc_gearCount and fnc_sanitizeInput function

This commit is contained in:
A Man
2022-03-25 15:09:34 +01:00
parent bae61cc31e
commit cf6ca366d3
7 changed files with 50 additions and 90 deletions

View File

@@ -964,6 +964,30 @@ fnc_lockCode = {
_code
};
fnc_gearCount = {
local _counter = 0;
{_counter = _counter + _x;} count _this;
_counter
};
fnc_sanitizeInput = {
local _input = _this select 0;
local _type = _this select 1; // 0 = Number, 1 = String
_input = toArray (_input);
local _badChars = [60,62,38,123,125,91,93,59,58,39,96,126,44,46,47,63,124,92,34];
{
_input = _input - [_x];
} forEach _badChars;
_input = toString (_input);
if (_type == 0) then {_input = parseNumber _input;};
_input
};
// Enable this if your server got nuked on Chernarus or Chernarus Winter.
/*
if (toLower worldName in ["chernarus","chernarus_winter"]) then { //need to add building coordinates for other maps