Respawn in captured territories

Respawn in captured territories

« posted: Aug 13, 2018, 05:57 PM »
I'm trying to replace the town respawn with the ability to respawn in any of your sides 'owned' territories. I figured out the file and bit of code I think I need to edit. Not getting any code errors, but it's still not working. I think I'm getting close, but figure it out.

In loadRespawnDialog.sqf I replaced;

Code: [Select]
_towns = [];
{
_town = _x select 0;
_town call _setPlayersInfo;
_towns pushBack _town;
} forEach (call cityList);

with

Code: [Select]
_currentTerritoryOwner =[];
_playerTeam = [];
_towns = [];

{
// private "_friendlyPlayers";
// _town = _x select 0;
_territory = _x select 0;
// _town call _setPlayersInfo;

if (_currentTerritoryOwner isEqualTo _playerTeam) then
{
// _towns pushBack _town;
_towns pushBack _territory;
};
// } forEach (call cityList);
} forEach (["config_territory_markers", []] call getPublicVar);/code]

I only know enough to modify scripts, not to just code outright, so I'm sure there's probably some unneeded or redundant pieces pasted in there. I'm also probably way off in how I'm going about accomplishing this.