Lunchbox

[Release] Announce due dates of territory payment on logon (Updated 5/1).

67 posts in this topic

Posted (edited)

This is a small script that announces when territory payments are due. The script is in American format currently, if you're European, flip %2 and %3 around in the _dueDate = format. Under _dueDate the format is like this:

%1 = Year
%2 = Month
%3 = Day

This doesn't count for 

["TaskCreated",["",format["<t color='#E48A36'>%2</t> territory payment due: <t color='#E48A36'>%1</t>",_dueDate,_name]]] call BIS_fnc_showNotification;

They are just calling the variable present in the event notification. %2 is calling the territory name and %1 is calling the due date.

Installation:
1. Add the file announcepay.sqf to your mission folder.

/* 
Created by Lunchbox for use with Exile mod for Arma 3.
Copyright 2016, Lunchbox, All rights reserved.
*/
	_playerUID = getPlayerUID player;
        {
            _flag = _x;
            _buildRights = _flag getVariable ["ExileTerritoryBuildRights", []];
            if (_playerUID in _buildRights) then
            {
			_nextDueDate = _flag getVariable ["ExileTerritoryMaintenanceDue", [0, 0, 0, 0, 0]];
			_name = _flag getVariable ["ExileTerritoryName", ""];
			_dueDate = format 
			[
				"%2/%3/%1",
				_nextDueDate select 0,
				_nextDueDate select 1,
				_nextDueDate select 2
			];
			 ["TaskCreated",["",format["<t color='#E48A36'>%2</t> territory payment due: <t color='#E48A36'>%1</t>",_dueDate,_name]]] call BIS_fnc_showNotification;
            };
        }
        forEach (allMissionObjects "Exile_Construction_Flag_Static");

2. Add this line at the bottom of your InitPlayerLocal.sqf:

waitUntil {!isNull findDisplay 46 && !isNil 'ExileClientLoadedIn' && getPlayerUID player != ''};
uiSleep 1;
execVM "announcepay.sqf";

3. Done.

Screenshots (This is what the user will see when they log in): 
njECPbI.png

v1.1 
- Added color
- Changed the way due dates were delivered. I couldn't get the exile messages to work correctly, no matter what I tried.

Edited by Lunchbox
19 people like this

Share this post


Link to post
Share on other sites

Nifty, EXILE should have something to this end as standard. 

1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

Loving this. Out of interest, what happens for players who don't have a territory?

Share this post


Link to post
Share on other sites

Posted (edited)

8 minutes ago, second_coming said:

nothing, they get no notification

Cheers for the clarification. :D

EDIT: I really should have read the code before posting. My bad..

Edited by kuplion

Share this post


Link to post
Share on other sites
8 hours ago, kuplion said:

Cheers for the clarification. :D

EDIT: I really should have read the code before posting. My bad..

Yeah, if the playerid isn't found in a territory, the if statement doesn't get run.

1 person likes this

Share this post


Link to post
Share on other sites

Just a small tip, it might be nice to have a check for the player to  be on the ground. I know some clients have some lag issues when parachuting in and the notifications really don't help :P

Share this post


Link to post
Share on other sites

Posted (edited)

On 4/30/2016 at 3:41 PM, Taylor Swift said:

Just a small tip, it might be nice to have a check for the player to  be on the ground. I know some clients have some lag issues when parachuting in and the notifications really don't help :P

On my personal server, I have a uiSleep30; run before it runs the check. 

Edit: I added a post on the next page of a check that will probably work.

Edited by Lunchbox

Share this post


Link to post
Share on other sites

This is great. The little things man, the little things. 

Share this post


Link to post
Share on other sites
5 minutes ago, zombietop said:

This is great. The little things man, the little things. 

Exactly, those QoL changes are what I am after.

2 people like this

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.