I have been using this script for a long time now and it has performed as intended. As of the last update to version 1.36 it stopped working. I'm running an Invade & Annex mission on a dedicated server and use the script to restrict a Wipeout CAS jet to trusted members and others who will not misuse it.
vipOnly.sqf
waitUntil {!isNull player};
_vehicle = _this select 0;
_vehicle addEventHandler ["GetIn",
{
private ["_veh", "_pos", "_unit", "_namesArray"];
_veh = _this select 0;
_pos = _this select 1;
_unit = _this select 2;
_namesArray = ["name1","name2","name3","name4"];
if !(name _unit in _namesArray) then
{
_unit action ["getOut", vehicle _unit];
if (isEngineOn _veh) then {_veh engineOn false};
systemChat format ["You need to be a VIPilot to fly this aircraft. Check FAQ in the menu on the map, top left corner!"];
};
}];
if(true) exitWith{};
fn_vSetup02
//===== wipeout skin and VIP only
if(_t in _wipeout) then {
[_u] execVM "scripts\vehicle\vipOnly.sqf";
_u setObjectTextureGlobal [0,'media\images\desert_camo_1.paa'];
_u setObjectTextureGlobal [1,'media\images\desert_camo_1.paa'];
};
mission.sqf
init="0 = [this,600,FALSE,QS_fnc_vSetup02] spawn QS_fnc_vMonitor;";
It still works when I'm running it on my own computer. I'm stuck and cant figure out what is wrong so I would very much appreciate some help to make it work again.