Untitled

 avatar
unknown
plain_text
3 years ago
969 B
7
Indexable
// 1 | stop if player tries to access virtual menu when other player is within x meters

    if (KINDOF_ARRAY(_x, _list)) exitWith {
        if (!(_x in life_vehicles) && {locked _x isEqualTo 2}) exitWith {
            hint localize "STR_MISC_VehInventory"; // allow
        };
        private _playerNear = (nearestObjects[_x, ["Man"], 12]) arrayIntersect playableUnits;
        if (count _playerNear > 1) exitWith {
            hint "You can't open the trunk while a player is near!"; 
        };
    };


// 2 | stop if other players are in vehicle

if ((count (crew vehicle player))> 1) exitWith {
    hint "You can't open the trunk while a player is in the vehicle with you!";
};


// 3 | random delay before opening virtual menu

_minTime = 1; // 1 second
_maxTime = 3; // 3 seconds
_sleepTime = (random (_maxTime - _minTime)) + _minTime;
sleep _sleepTime;


// 4 | use heartbeat to check players every 20ms. if bad signal disable virtual menu/veh inv/house inv

Editor is loading...