Jump to content

Unlock vehicles left in trader over restart


Brian Soanes

Recommended Posts

To unlock vehicles left in your traders over a server restart, open your epoch_server.pbo

In epoch_server\compile\epoch_vehicle\EPOCH_load_vehicles.sqf
Find

if (_allowDamage) then {

Just above that, add this

A3E_SafeZonePosArray =
[
	[[18451.9,14278.1,0]],   //Altis East trader
	[[13333.5,14494.3,0]],   //Altis Central trader
	[[6192.46,16834,0]]      //Altis West trader
];

{
	if (_vehicle distance (_x select 0) < 200) then
    {
        _vehicle lock false;
        diag_log format["Vehicle %1 left in trader unlocked @ %2", _class, mapGridPosition _vehicle];
    };
} forEach A3E_SafeZonePosArray;

Pack pbo and you're good to go

Link to comment
Share on other sites

I think we can also use this instead.

Quote

                        _restricted = nearestObjects [_vehicle, ["ProtectionZone_Invisible_F"], 200];
                        if !(_restricted isEqualTo []) then {
                            _vehicle lock false;
                            diag_log format["Vehicle %1 left in trader unlocked @ %2", _class, mapGridPosition _vehicle];
                        };

 

Link to comment
Share on other sites

Not all trader camps have protection zones or props...

Better way though for vanilla A3E users (rather than hard coding them) would be:

private _config = configFile >> "CfgEpoch";
private _configWorld = _config >> worldname;
private _A3E_SafeZonePosArray  = [];
{
    _A3E_SafeZonePosArray  pushback [_x select 3, 200];
} foreach (getArray(_configWorld >> "telePos"));

{
    if (_vehicle distance (_x select 0) < (_x select 1)) then
    {
        _vehicle lock false;
        diag_log format["Vehicle %1 left in trader unlocked @ %2", _class, mapGridPosition _vehicle];
    };
} forEach _A3E_SafeZonePosArray;

Then you get the locations from the map files in epoch_server_settings...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...