ProGEEK

Fix for Towing issue and Trader Zones

17 posts in this topic

Towing vehicles into safe zones using R3F causes the towed vehicle to be launched

Disabling the code that causes bombs to drop off fixes this issue.

modify your config.cpp file in your mission pbo and add the ExileClient_object_player_event_onEnterSafezone.sqf file.

https://gist.github.com/anonymous/2a377a731b81c1121c36

config.cpp

class CfgExileCustomCode 
{
	/*
		You can overwrite every single file of our code without touching it.
		To do that, add the function name you want to overwrite plus the 
		path to your custom file here. If you wonder how this works, have a
		look at our bootstrap/fn_preInit.sqf function.
		Simply add the following scheme here:
		<Function Name of Exile> = "<New File Name>";
		Example:
		ExileClient_util_fusRoDah = "myaddon\myfunction.sqf";
	*/
	// Disable Bomb dropping on safe zone
	ExileClient_object_player_event_onEnterSafezone = "ExileClient_object_player_event_onEnterSafezone.sqf";
};

ExileClient_object_player_event_onEnterSafezone.sqf

/**
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_vehicle","_attachedObjects","_position"];
if (ExilePlayerInSafezone) exitWith { false };
ExilePlayerInSafezone = true;
if (alive player) then
{
	player allowDamage false;
	player removeAllEventHandlers "HandleDamage";
};
_vehicle = vehicle player;
if !(_vehicle isEqualTo player) then 
{
	if (local _vehicle) then 
	{
		_vehicle allowDamage false;
	};
	/*
 DISABLED TO FIX DROPPING ISSUE
	_attachedObjects = attachedObjects _vehicle;
	if !(_attachedObjects isEqualTo []) then 
	{
		_position = getPosATL _vehicle;
		{
			detach _x;
			_x setPosATL [(_position select 0) + random 2, (_position select 1) + random 2, 0.05];
			_x setDir (random 260);
		}
		forEach _attachedObjects;
	};*/
	ExileClientSafeZoneVehicle = _vehicle;
	ExileClientSafeZoneVehicleFiredEventHandler = _vehicle addEventHandler ["Fired", {_this call ExileClient_object_player_event_onFiredSafeZoneVehicle}];
};
ExileClientSafeZoneESPEventHandler = addMissionEventHandler ["Draw3D", {20 call ExileClient_gui_safezone_safeESP}];
["SafezoneEnter"] call ExileClient_gui_notification_event_addNotification;
ExileClientSafeZoneUpdateThreadHandle = [1, ExileClient_object_player_thread_safeZone, [], true] call ExileClient_system_thread_addtask;
true

 

Edited by ProGEEK
1 person likes this

Share this post


Link to post
Share on other sites

Here's a fix that works with dropping bombs but not vehicles etc

ExileClient_object_player_event_onEnterSafezone.sqf

/**
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_vehicle","_attachedObjects","_position", "_vehicles"];

if (ExilePlayerInSafezone) exitWith { false };
ExilePlayerInSafezone = true;
if (alive player) then
{
	player allowDamage false;
	player removeAllEventHandlers "HandleDamage";
};
_vehicle = vehicle player;
if !(_vehicle isEqualTo player) then 
{
	if (local _vehicle) then 
	{
		_vehicle allowDamage false;
	};
	_attachedObjects = attachedObjects _vehicle;
	if !(_attachedObjects isEqualTo []) then 
	{
		_position = getPosATL _vehicle;
		{
			if ((_x isKindOf "PipeBombBase")) then
			{
				detach _x;
				_x setPosATL [(_position select 0) + random 2, (_position select 1) + random 2, 0.05];
				_x setDir (random 260);
			};
		}
		forEach _attachedObjects;
	};
	ExileClientSafeZoneVehicle = _vehicle;
	ExileClientSafeZoneVehicleFiredEventHandler = _vehicle addEventHandler ["Fired", {_this call ExileClient_object_player_event_onFiredSafeZoneVehicle}];
}else{
	_attachedObjects = attachedObjects _vehicle;
	if !(_attachedObjects isEqualTo []) then 
	{
		_position = getPosATL _vehicle;
		{
			if ((_x isKindOf "PipeBombBase")) then
			{
				detach _x;
				_x setPosATL [(_position select 0) + random 2, (_position select 1) + random 2, 0.05];
				_x setDir (random 260);
			};
		}
		forEach _attachedObjects;
	};
};
ExileClientSafeZoneESPEventHandler = addMissionEventHandler ["Draw3D", {20 call ExileClient_gui_safezone_safeESP}];
["SafezoneEnter"] call ExileClient_gui_notification_event_addNotification;
ExileClientSafeZoneUpdateThreadHandle = [1, ExileClient_object_player_thread_safeZone, [], true] call ExileClient_system_thread_addtask;
true

 

Edited by SilentSean
3 people like this

Share this post


Link to post
Share on other sites
Advertisement
_attachedObjects = attachedObjects _vehicle;
	if !(_attachedObjects isEqualTo []) then 
	{

What about

  _attachedObjects = attachedObjects _vehicle;
  _attachedBlackList = ["SatchelCharge_Remote_Mag","SatchelCharge_Remote_Ammo"]
;
  	if (_attachedObjects isEqualTo _attachedBlackList) then 
  	{

 

2 people like this

Share this post


Link to post
Share on other sites

seems i added it to my test server now popup for safezone join and leave are gone and no protection

Share this post


Link to post
Share on other sites

seems i added it to my test server now popup for safezone join and leave are gone and no protection

Works fine on mine.

Share this post


Link to post
Share on other sites

Works fine on mine.

do ihave change anything if i add it in a folder cause i did    ExileClient_object_player_event_onEnterSafezone = "fixes/ExileClient_object_player_event_onEnterSafezone.sqf";

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.