2016-04-28 11:31:00 +00:00
|
|
|
private ["_flags","_flag"];
|
|
|
|
_flags = nearestObjects [player,["Exile_Construction_Flag_Static"],150];
|
|
|
|
|
2016-06-06 22:23:54 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
if(count _flags == 0)exitWith{
|
|
|
|
throw "No connetion to a Virtual Garage"
|
|
|
|
};
|
2016-04-28 11:31:00 +00:00
|
|
|
|
2016-06-06 22:23:54 +00:00
|
|
|
_flag = _flags select 0;
|
|
|
|
if((player distance _flag) > (_flag getVariable ["ExileTerritorySize", 50]))exitWith{
|
|
|
|
throw "Weak signal, get closer"
|
|
|
|
};
|
2016-04-28 11:31:00 +00:00
|
|
|
|
2016-06-06 22:23:54 +00:00
|
|
|
if((([_flag, getPlayerUID player] call ExileClient_util_territory_getAccessLevel) select 0) >= ExAd_VG_ACCESS_LEVEL)then{
|
|
|
|
ExAdCurFlagNetId = netId _flag;
|
2016-07-03 18:11:58 +00:00
|
|
|
call ExAd_fnc_loadVGContent;
|
2016-06-06 22:23:54 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
throw "You aren't eligible to access this virtual garage!"
|
|
|
|
}
|
2016-04-28 11:31:00 +00:00
|
|
|
}
|
2016-06-06 22:23:54 +00:00
|
|
|
catch
|
2016-04-28 11:31:00 +00:00
|
|
|
{
|
2016-07-03 18:11:58 +00:00
|
|
|
["ErrorTitleAndText", ["ExAd - Virtual Garage", _exception]] call ExileClient_gui_toaster_addTemplateToast;
|
|
|
|
["extraApps", 1] call ExileClient_gui_xm8_slide
|
2016-04-28 11:31:00 +00:00
|
|
|
}
|