ExAd/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/VG/onOpen.sqf

28 lines
773 B
Plaintext
Raw Normal View History

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;
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
{
["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
}