Territory payout range

  • Offline eldude
  • Fresh Spawn
  • *
  • Posts: 11

Territory payout range

« posted: May 16, 2018, 12:49 AM »
Hi there,

Hoping somebody can assist, I've followed two threads on here, one was to get random territories on restart which worked:
http://forums.a3wasteland.com/index.php?topic=3363.0

The other is the one I'm having issues with and I don't know if it's because I'm trying to do both (?).

I want to limit the payout range in order to keep people fighting at the territories I've set (which are clustered up in one town area):
http://forums.a3wasteland.com/index.php?topic=2763

I'm using this code in my TerritoryActivityHandler.sqf:

Code: [Select]
// Called with [_message, _money(optional)], "A3W_fnc_territoryActivityHandler", side, false] call A3W_fnc_MP;

diag_log format["A3W_fnc_territoryActivityHandler called with %1", _this];

if (typeName _this == "ARRAY" && {count _this >= 1}) then {
_msg = _this select 0;
_money = 0; if (count _this >= 2) then { _money = _this select 1; };

_inrange_payout = false;
{
if ((_x select 2) in [group player, playerSide] && {player distance markerPos (_x select 0) <= 2000}) exitWith
{
_inrange_payout = true;
};
} forEach currentTerritoryDetails;

if (_inrange_payout) then
      {
         player setVariable ["cmoney", (player getVariable ["cmoney", 0]) + _money, true];
      }
      else
      {
titleText ["You are more than 2km away from the capture territories so you received no money.", "plain down", 0.5];
      };     

playSound 'FD_Finish_F'; // Nice sound effect to draw players attention to the notification
};

But currently I'm capping the territories and even though I'm in the middle of it, it's saying I'm more than 2km away and I'm not being paid.

I'm not a coder, I'm just trying to figure this all out slowly so any layman's/linear advice or guidance is much appreciated.

Thanks in advance!
  • Offline eldude
  • Fresh Spawn
  • *
  • Posts: 11

Re: Territory payout range

« Reply #1 posted: May 29, 2018, 01:59 PM »
Polite bump - anybody had existing coding or able to assist in any way? Our server is doing really well but want to keep up the momentum. Many thanks.