From Savage Game Design Wiki
Revision as of 12:47, 16 September 2019 by vn>Unknown user
Jump to navigation
Jump to search
Description
/*
FILE: fn_whitelisted_arsenal_client.sqf
DATE: 27-07-2019
AUTHOR: Ethan Johnson
DESCRIPTION:
Adds all client stuff for the whitelisted arsenal funtions
PARAMETERS:
NONE
RETURNS:
NONE
*/
waitUntil {!isNil "vn_whitelisted_arsenal_loadouts" && {!isNil "vn_whitelisted_arsenal_parameter"}};
private _equipment = (vn_whitelisted_arsenal_parameter#3);
vn_customarsenalopening = false;
private _vn_arsenalopened_function =
{
params [["_display",displayNull,[displayNull]]];
private _is_zeus = !isNull (findDisplay 312);
private _is_admin = call BIS_fnc_admin >= 2;
switch true do
{
case (!vn_customarsenalopening && {_is_zeus}):
{
["showMessage", [_display, localize "STR_VN_WA_FEEDBACK_ARSENAL_ACCESS_ZEUS"]] call bis_fnc_arsenal;
false
};
case (!vn_customarsenalopening && {_is_admin}):
{
["showMessage", [_display, localize "STR_VN_WA_FEEDBACK_ARSENAL_ACCESS_ADMIN"]] call bis_fnc_arsenal;
false
};
case !vn_customarsenalopening:
{
cutText ["", "BLACK FADED", 0];
waitUntil{!(isNull (uinamespace getvariable ["RscDisplayArsenal",displayNull]))};
(uinamespace getvariable "RscDisplayArsenal") closeDisplay 2;
vn_customarsenalopening = true;
[] spawn
{
[player] call vn_fnc_whitelisted_arsenal_calculate_access;
["Open",[false, vn_whitelisted_arsenal_player_whitelist_object, player]] call bis_fnc_arsenal;
waitUntil{!(isNull (uinamespace getvariable ["RscDisplayArsenal",displayNull]))};
cutText ["", "BLACK IN", 0.2];
vn_customarsenalopening = false;
[(uinamespace getvariable "RscDisplayArsenal")] call vn_fnc_whitelisted_arsenal_override;
};
true
};
};
};
//Check if the equipment should be restricted
if (_equipment in [0,2]) then
{
[ missionnamespace, "arsenalOpened", _vn_arsenalopened_function ] call BIS_fnc_addScriptedEventHandler;
};
//Check if the vehicles should be restricted
if (_equipment in [1,2]) then
{
player addEventHandler ["GetInMan",
{
params ["_unit", "_role", "_vehicle", "_turret"];
[player] call vn_fnc_whitelisted_arsenal_calculate_access;
[_vehicle] call vn_fnc_whitelisted_arsenal_vehicle_eject;
}];
player addEventHandler ["SeatSwitchedMan",
{
params ["_unit1", "_unit2", "_vehicle"];
[player] call vn_fnc_whitelisted_arsenal_calculate_access;
[_vehicle] call vn_fnc_whitelisted_arsenal_vehicle_eject;
}];
};
(Placeholder description extracted from the function header by LM_exportFunctionsToWiki.sqf)
Syntax
- Syntax
- [] call VN_fnc_whitelisted_arsenal_client;
- Return value
- Nothing
Examples
- Example 1
-