Sign in to follow this  
Followers 0
oSoDirty

Easy Safezone Messages

5 posts in this topic

I have noticed that a fair amount of people (including myself) have been looking for a way to add/edit safezone messages. The default messages are defined in the config.bin and cannot be altered.

However I have come up with a simple solution. So here it is:

 

If you have already overwritten your  ExileClient_object_player_event_onEnterSafezone.sqf  (R3F Logistics requires this so if your using it you already have this done.) If this is the case simply locate the overwitten file in your mission pbo and look for:

Spoiler

if (alive player) then
{
	player allowDamage false;
	player removeAllEventHandlers "HandleDamage";
};

 

and change it to this:

Spoiler

if (alive player) then
{
	player allowDamage false;
	player removeAllEventHandlers "HandleDamage";
	hint "You have entered a safezone. \nVehicles left in trader unlock upon restart. \nCamping is not bannable, but frowned upon. \nBe careful with your vehicles \nbecause stealing is allowed."; //Edit to your liking \n forces a new line
};

 

Just edit the added line to fit your needs. Repack, restart and enjoy.

 

If you do not have the file overwritten then copy and paste this:

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 };
ExilePlayerInSafezone = true;
if (alive player) then
{
	player allowDamage false;
	player removeAllEventHandlers "HandleDamage";
	hint "You have entered a safezone. \nVehicles left in trader unlock upon restart. \nCamping is not bannable, but frowned upon. \nBe careful with your vehicles \nbecause stealing is allowed."; //Edit to your liking \n forces a new line
};
_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

 

into notepad++, edit the added line to fit your needs, and save it as ExileClient_object_player_event_onEnterSafezone.sqf  Place it in the root of your mission pbo. 

Now in your mission pbo open config.cpp locate this:

Spoiler

class CfgExileCustomCode 
{
};

 

and change to this:

Spoiler

class CfgExileCustomCode 
{
	ExileClient_object_player_event_onEnterSafezone = "ExileClient_object_player_event_onEnterSafezone.sqf";
};

 

And that is all.  Repack your mission pbo, reboot your server and enjoy!

Edited by oSoDirty
1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

Uhm why do you use hints, use Exile notifications like so; 

Spoiler

 ["notificationRequest",["LockKickWarning",["Server locked for Quick Restart in 10 Minutes"]]] call ExileServer_system_network_send_broadcast;

There is different kinds, this is the standard one for "Lock Kick Warning" in your @exile_server\config. 

No need to use hints ^_^

Note: ExileServer_system_network_send_broadcast; will broadcast messages to everyone, whereas ExileClient_gui_notification_event_addNotification; only will execute locally on the player that trigger the event.

EDIT: CfgNotifications

Spoiler

 SafeIsLockedWarning
MaximumNumberOfTerritoriesReached
RepairFailedWarning
VehicleCustomsWarningNothingToCustomize
VehicleCustomsWarningNoVehiclesNearby
ProtectionMoneyPaidInformation
AddedToTerritoryMessage
PartyInviteMessage
PartyCreatedMessage
ClanRegisteredMessage
MoneySent
MoneyReceived
Whoops
RestartWarning
LockKickWarning
Success
ItemConsumedInformation
ItemCraftedInformation
InventoryFullWarning
InspectingFailedInformation
TurnedIntoABushNotification
TreasureMarkerInformation
ItemPurchasedInformation
ItemSoldInformation
ItemSoldInformationWithRespect
VehiclePurchasedInformation
VehicleSkinPurchasedInformation
ConstructionPlacedInformation
SafePlacedInformation
ConstructionAbortedInformation
ConstructionAbortedCombat
ConstructionVehicleWarning
ConstructionSpawnZoneWarning
ConstructionTraderZoneWarning
ConstructionMovedTooFarWarning
NoMatchesWarning
SafezoneEnter
SafezoneLeave
EarplugsOn
EarplugsOff
VehicleRefuled
VehicleRefulingFailed
VehicleRefulingFailedFull
VehicleDrained
VehicleDrainingFailed
VehicleDrainingFailedFuel
TerritoryPurchased
 

These will replace "LockKickWarning", and shows another icon. (Most of the icons are the same.) 

-----------------------------------------------------------------

For the actual Exile safezone enter / leave messages use these from 

ExileClient_object_player_event_onEnterSafezone.sqf
ExileClient_object_player_event_onLeaveSafezone.sqf

Spoiler

["SafezoneEnter"] call ExileClient_gui_notification_event_addNotification; (For entering safezone)
["SafezoneLeave"] call ExileClient_gui_notification_event_addNotification; (For leaving safezone)

screenshot.134.thumb.jpg.898dc08d83352a5

screenshot.135.thumb.jpg.e9f118f9784d6b8

Edited by ka0s
Extra classes and actual SafezoneEnter / Leave notifications added.
1 person likes this

Share this post


Link to post
Share on other sites

@Ka0s  I Just wanted something simple and small for detailed safe zone messages.

@ArnieGAMES4U It only mismatches if you edited the exile_client.pbo it's self.   You need to copy the file into your mission PBO, edit it as described above and add the overwrite in config.cpp as described above. If you messed up and repacked an edited exile_client.pbo, just grab the vanilla  ExileClient_object_player_event_onEnterSafezone.sqf  from your game's mod folder.

Share this post


Link to post
Share on other sites
On 2/26/2016 at 3:07 PM, ka0s said:
 
Spoiler

 SafeIsLockedWarning
MaximumNumberOfTerritoriesReached
RepairFailedWarning
VehicleCustomsWarningNothingToCustomize
VehicleCustomsWarningNoVehiclesNearby
ProtectionMoneyPaidInformation
AddedToTerritoryMessage
PartyInviteMessage
PartyCreatedMessage
ClanRegisteredMessage
MoneySent
MoneyReceived
Whoops
RestartWarning
LockKickWarning
Success
ItemConsumedInformation
ItemCraftedInformation
InventoryFullWarning
InspectingFailedInformation
TurnedIntoABushNotification
TreasureMarkerInformation
ItemPurchasedInformation
ItemSoldInformation
ItemSoldInformationWithRespect
VehiclePurchasedInformation
VehicleSkinPurchasedInformation
ConstructionPlacedInformation
SafePlacedInformation
ConstructionAbortedInformation
ConstructionAbortedCombat
ConstructionVehicleWarning
ConstructionSpawnZoneWarning
ConstructionTraderZoneWarning
ConstructionMovedTooFarWarning
NoMatchesWarning
SafezoneEnter
SafezoneLeave
EarplugsOn
EarplugsOff
VehicleRefuled
VehicleRefulingFailed
VehicleRefulingFailedFull
VehicleDrained
VehicleDrainingFailed
VehicleDrainingFailedFuel
TerritoryPurchased

 

Thanks for this, it's been quite helpful to me lately xD

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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.