• 0
Lenzh | 11thAMB

Message on entering safe zone

Question

Hi when i enter my trader cities i get no message that i've entered them, but when i leave i get a message that i left.

how do i fix this

my exileclient_object_player_event_onentersafezone:


/**
 * ExileClient_object_player_event_onEnterSafezone
 *
 * 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;
	};
	_attachedObjects = attachedObjects _vehicle;
	if !(_attachedObjects isEqualTo []) then 
	{
		_position = getPosATL _vehicle;
		{
			if ((typeOf _x) in ["DemoCharge_Remote_Mag", "SatchelCharge_Remote_Mag"]) then 
			{
				detach _x;
				_x setPosATL [(_position select 0) + random 2, (_position select 1) + random 2, 0.05];
				_x setDir (random 360);
			};
		}
		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

my config.cpp (class custom code)

class CfgExileCustomCode 
{
//ExAdClient VirtualGarage
	ExileServer_system_territory_database_load = "ExAdClient\VirtualGarage\CustomCode\ExileServer_system_territory_database_load.sqf";

	//ExAdClient XM8
	ExileClient_gui_xm8_slide = "ExAdClient\XM8\CustomCode\ExileClient_gui_xm8_slide.sqf";
	ExileClient_gui_xm8_show = "ExAdClient\XM8\CustomCode\ExileClient_gui_xm8_show.sqf";
	
	//Safezone
	ExileClient_object_player_event_onEnterSafezone = "Overrides\ExileClient_object_player_event_onEnterSafezone.sqf";
	
	//Blocks a vehicle sell glitch that generates endless money!
	ExileClient_gui_wasteDumpDialog_event_onSellButtonClick = "Overrides\ExileClient_gui_wasteDumpDialog_event_onSellButtonClick.sqf";
	
	//Enigma Deploybike
	ExileClient_gui_inventory_event_onSlotDoubleClick = "Custom\EnigmaPersonalVehicle\ExileClient_gui_inventory_event_onSlotDoubleClick.sqf"; 
	
	//EnigmaRevive		
    ExileClient_object_player_death_startBleedingOut = "custom\EnigmaRevive\ExileClient_object_player_death_startBleedingOut.sqf"; //Happys Revive
    ExileClient_object_player_event_onInventoryOpened = "custom\EnigmaRevive\ExileClient_object_player_event_onInventoryOpened.sqf"; //Happys Revive AntiDupe ---NEW with v0.65
};

 

Share this post


Link to post
Share on other sites

6 answers to this question

  • 0

Edit your

CfgExileCustomCode

//safezone
    ExileClient_object_player_event_onEnterSafezone = "overrides\ExileClient_object_player_event_onEnterSafezone.sqf";
    ExileClient_object_player_event_onLeaveSafezone = "overrides\ExileClient_object_player_event_onLeaveSafezone.sqf";

then create

ExileClient_object_player_event_onEnterSafezone.sqf

Spoiler

/**
* ExileClient_object_player_event_onEnterSafezone
*
* 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 };
if !(alive player) exitWith { false };
ExilePlayerInSafezone = true;
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 ((typeOf _x) in ["DemoCharge_Remote_Mag", "SatchelCharge_Remote_Mag"]) then
		{
			detach _x;
			_x setPosATL [(_position select 0) + random 2, (_position select 1) + random 2, 0.05];
			_x setDir (random 360);
		};
	}
	forEach _attachedObjects;
};
ExileClientSafeZoneVehicle = _vehicle;
};
ExileClientSafeZoneESPEventHandler = addMissionEventHandler ["Draw3D", {20 call ExileClient_gui_safezone_safeESP}];
["InfoTitleAndText", ["Welcome!", "You have entered a Safe Haven."]] call ExileClient_gui_toaster_addTemplateToast;
ExileClientSafeZoneUpdateThreadHandle = [1, ExileClient_object_player_thread_safeZone, [], true] call ExileClient_system_thread_addtask;
true

 

and create ExileClient_object_player_event_onLeaveSafezone.sqf

Spoiler

/**
 * ExileClient_object_player_event_onLeaveSafezone
 *
 * 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"];
if !(ExilePlayerInSafezone) exitWith { false };
_vehicle = vehicle player;
ExilePlayerInSafezone = false;
if !(isNil "ExileClientSafeZoneUpdateThreadHandle") then
{
	[ExileClientSafeZoneUpdateThreadHandle] call ExileClient_system_thread_removeTask;
	ExileClientSafeZoneUpdateThreadHandle = nil;
};
player allowDamage true;
player addEventHandler ["HandleDamage", {_this call ExileClient_object_player_event_onHandleDamage}];
if !(isNull ExileClientSafeZoneVehicle) then
{
	if (local ExileClientSafeZoneVehicle) then
	{
		ExileClientSafeZoneVehicle allowDamage true;
	};
	ExileClientSafeZoneVehicle removeEventHandler ["Fired", ExileClientSafeZoneVehicleFiredEventHandler];
	ExileClientSafeZoneVehicle = objNull;
	ExileClientSafeZoneVehicleFiredEventHandler = nil;
};
if !(_vehicle isEqualTo player) then
{
	if (local _vehicle) then
	{
		_vehicle allowDamage true;
	};
};
if !(isNil "ExileClientSafeZoneESPEventHandler") then
{
	removeMissionEventHandler ["Draw3D", ExileClientSafeZoneESPEventHandler];
	ExileClientSafeZoneESPEventHandler = nil;
};
if (alive player) then
{
	["InfoTitleAndText", ["Goodbye!", "You have left the safe Haven."]] call ExileClient_gui_toaster_addTemplateToast; 
};
true

 

this should allow both entering and leaving message

 

 

 

 

 

1 person likes this

Share this post


Link to post
Share on other sites
Advertisement
  • 0
On 2/23/2017 at 9:26 PM, Lenzh | 11thAMB said:

and i solved it again

how did you resolve this? I'm experiencing this as well.

Share this post


Link to post
Share on other sites
  • 0
11 hours ago, tinboye said:

["InfoTitleAndText", ["Welcome!", "You have entered a Safe Haven."]] call ExileClient_gui_toaster_addTemplateToast;

this is the important part i didnt had this!

Share this post


Link to post
Share on other sites
  • 0
On 2/26/2017 at 9:05 AM, Lenzh | 11thAMB said:

this is the important part i didnt had this!

Ahhhhh!!! I was confused at first, but after comparing the override from R3F with Exile's default file, I see what you mean now. THANK YOU! :D

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.