BIS_fnc_EGSpectator offers a function "IsLocationIdUsed", but the code does ignore input.
case "IsLocationIdUsed" : { private _locations = missionNamespace getVariable [VAR_LOCATIONS, []]; private _index = -1; { if (_x select 0 == _id) exitWith { _index = _forEachIndex; }; } forEach _locations;
_id is not defined, and should probably be
private _id = _params select 0;