geekm0nkey

[Release] PVP Map Markers

23 posts in this topic

This mod creates a circle marker around all players online that meet the criteria (explained below). The marker radius and refresh time are adjustable. The purpose of this mod is to encourage PVP action on your server especially during low pop times. There is now a config.sqf in the root of the PBO with adjustable options. Here is a list of features.

  • Markers only appear when players are actively holding a weapon, not in a territory, not in safe zone and not in a vehicle.
  • Markers change color depending upon number of pop tabs on player. Blue = < 10k, Yellow = > 10k and Green = > 50k
  • Adjustable markers update timer, default is 5 minutes.
  • Adjustable marker radius defaults to 300 meters.
  • Adjustable minimum and maximum players online to trigger markers.
  • Adjustable marker icon.
  • Adjustable marker text.
  • Ability to exclude players from being marked.

Happy PVP'ing

SCREENSHOT:
(note this is how i see myself, players do not see player marker inside the circle!)

ApplicationFrameHost_2018-03-03_19-59-13.png

INSTALLATION: Download the file - pvpmapmarkers.pbo or pvpmapmarkers_dow.pbo (Ducks of War version) [USE ONE OR THE OTHER NOT BOTH!]

Just drop the PBO file into your @ExileServer/addons folder, and your done.. UnPBO the file if you want to make any changes. Config file will be in the root of the PBO folder after it has been uncompressed.

Disclaimer....!!!.... This has been somewhat tested.. There may have been conditions and situations I've overlooked. Anyone care to help be my guest..

SOURCE CODE: ( for those untrusting types... ;) )

Spoiler

 

/*
PVP Map Markers
Created by Geekm0nkey for Arma 3 Exile.
Copyright 2018, Geekm0nkey, All rights reserved.
*/

private["_counter"];

// DO NOT EDIT BELOW THIS LINE!    
diag_log text "[PVPMM]: PVP map markers is active...";

/* All the functions */
fn_PVP_onJoin = {
    private["_id","_name","_uid","_justPlayers","_PlayerCount","_PlyrUid","_PlyrSID","_PlyrName","_PlyrPosi","_PlyrAliv","_PlyrWeap","_PlyrMony","_PlyrSafe","_PlyrX","_PlyrY","_rndm","_rndmX","_rndmY","_PlyrinTerritory","_markerstr","_markerstr2","_markerstr3","_PVPreasons"];
    
    _id     = _this select 0;
    _name   = _this select 1;
    _uid    = _this select 2;
    
    if (_name != "__SERVER__") then
    {
        uiSleep 10;
        _justPlayers = allPlayers - entities "HeadlessClient_F";
        
        if (count _justPlayers < PVPMMGV_minplay) then { _PlayerCount = "is not enough players" };
        if (count _justPlayers > PVPMMGV_maxplay) then { _PlayerCount = "is to many players" };
        
        if !(isNil "_PlayerCount") then {
            diag_log text format["[PVPMM]: Disabled because of player count (%1) %2", count _justPlayers, _PlayerCount];
        }else {
            diag_log text "[PVPMM]: PVP map markers adding new marker";
            {
                _y = _x;
                if (getPlayerUID _y == _uid) exitWith
                {
                    _PlyrUid  = getPlayerUID _y;
                    _PlyrSID  = owner _y;
                    _PlyrName = name _y;
                    _PlyrPosi = position _y;
                    _PlyrAliv = alive _y;
                    _PlyrWeap = currentWeapon _y;
                    _PlyrMony = _y getVariable ["ExileMoney", 0];
                    _PlyrSafe = false;
                    
                    _PlyrX = _PlyrPosi select 0;
                    _PlyrY = _PlyrPosi select 1;
                    
                    _rndm  = round(random [50, (PVPMMGV_mradius-50)/2, PVPMMGV_mradius]);
                    _rndmX = _PlyrX + (_rndm * selectRandom [-1,1]);
                    _rndm  = round(random [50, (PVPMMGV_mradius-50)/2, PVPMMGV_mradius]);
                    _rndmY = _PlyrY + (_rndm * selectRandom [-1,1]);
                    
                    _PlyrinTerritory = _y call ExileClient_util_world_getTerritoryAtPosition;
                    
                    {
                        if (((_x select 0) distance2D _PlyrPosi) < (_x select 1)) exitWith
                        {
                            _PlyrSafe = true;
                        };
                    } forEach ExileTraderZoneMarkerPositionsAndSize;
                    
                    if ((_PlyrWeap != "") && (_PlyrAliv) && (vehicle _y == _y) && !(_PlyrSafe) && (isNull _PlyrinTerritory) && !(_PlyrUid in PVPMMGV_exclude)) then
                    {
                        _markerstr = createMarker [_PlyrUid, [_rndmX, _rndmY]];
                        _markerstr setMarkerType "Empty";
                        _markerstr setMarkerShape "ELLIPSE";
                        _markerstr setMarkerColor "ColorBlue";
                        if (_PlyrMony >= 10000) then { _markerstr setMarkerColor "ColorYellow"; };
                        if (_PlyrMony >= 50000) then { _markerstr setMarkerColor "ColorGreen"; };
                        _markerstr setMarkerBrush "SolidBorder";
                        _markerstr setMarkerAlpha 0.25;
                        _markerstr setMarkerSize [PVPMMGV_mradius,PVPMMGV_mradius];
                        
                        _markerstr2 = createmarker [format["%1-brdr",_PlyrUid], [_rndmX, _rndmY]];
                        _markerstr2 setMarkerShape "ELLIPSE";
                        _markerstr2 setMarkerColor "ColorWhite";
                        _markerstr2 setMarkerBrush "Border";
                        _markerstr2 setMarkerSize [PVPMMGV_mradius,PVPMMGV_mradius];
            
                        _markerstr3 = createMarker [format["%1-text",_PlyrUid], [_rndmX, _rndmY]];
                        _markerstr3    setMarkerShape "ICON";
                        _markerstr3 setMarkerColor "ColorWhite";
                        
                        if !(PVPMMGV_mrkrico == "") then { _markerstr3 setMarkerType PVPMMGV_mrkrico; };
                        if !(PVPMMGV_mrkrtxt == "") then { _markerstr3 setMarkerText PVPMMGV_mrkrtxt; };
                        
                        [_PlyrSID, "toastRequest", ["ErrorTitleOnly", ["PVP Marker Active!"]]] call ExileServer_system_network_send_to;
                        _y setVariable["PVPSeenNotice", "active"];
                        diag_log text format["[PVPMM]: Marker enabled for %1", _PlyrName];
                    }else {
                        _PVPreasons = [];
                        if (_PlyrWeap == "")                then { _PVPreasons pushBack "no weapon"; };
                        if (_PlyrSafe)                      then { _PVPreasons pushBack "safe zone"; };                    
                        if !(_PlyrAliv)                     then { _PVPreasons pushBack "is dead"; };            
                        if (vehicle _y != _y)                  then { _PVPreasons pushBack "driving"; };             
                        if !(isNull _PlyrinTerritory)         then { _PVPreasons pushBack "in territory"; };
                        if (_PlyrUid in PVPMMGV_exclude)       then { _PVPreasons pushBack "is excluded"; };
                        _PVPreasons = _PVPreasons joinString ", ";
                        [_PlyrSID, "toastRequest", ["SuccessTitleAndText", ["PVP Marker Inactive!",format["Because (%1)", _PVPreasons]]]] call ExileServer_system_network_send_to;
                        _y setVariable["PVPSeenNotice", "inactive"];
                        diag_log text format["[PVPMM]: Marker disabled for %1 because (%2)", _PlyrName, _PVPreasons];
                    };
                };
            } forEach _justPlayers;
        };
    };
};

fn_PVP_onPart = {
    
    private["_id","_name","_uid"];
    
    _id     = _this select 0;
    _name     = _this select 1;
    _uid     = _this select 2;
    
    deleteMarker _uid;
    deleteMarker format["%1-brdr",_uid];
    deleteMarker format["%1-text",_uid];
    diag_log text format["[PVPMM]: Marker removed for %1 (disconnected)", _name];
};
    
["PVPMMonJoinCall", "onPlayerConnected",      { [_id, _name, _uid] spawn fn_PVP_onJoin }] call BIS_fnc_addStackedEventHandler;
["PVPMMonPartCall", "onPlayerDisconnected",  { [_id, _name, _uid] call fn_PVP_onPart }] call BIS_fnc_addStackedEventHandler;

_counter = PVPMMGV_seconds;

while {true} do
{    
    private["_id","_name","_uid","_justPlayers","_PlayerCount","_PlyrUid","_PlyrSID","_PlyrName","_PlyrPosi","_PlyrAliv","_PlyrWeap","_PlyrMony","_PlyrNotc","_PlyrSafe","_PlyrX","_PlyrY","_rndm","_rndmX","_rndmY","_PlyrinTerritory","_MarkerType","_markerstr","_markerstr2","_markerstr3","_PVPreasons"];
    
    uiSleep 30;
    if (_counter <= 0) then
    {
        _counter = PVPMMGV_seconds;
        _justPlayers = allPlayers - entities "HeadlessClient_F";

        if (count _justPlayers < PVPMMGV_minplay) then { _PlayerCount = "is not enough players" };
        if (count _justPlayers > PVPMMGV_maxplay) then { _PlayerCount = "is to many players" };
        
        if !(isNil "_PlayerCount") then {
            diag_log text format["[PVPMM]: Disabled because of player count (%1) %2", count _justPlayers, _PlayerCount];
        }else {
            diag_log text "[PVPMM]: PVP map markers updating all markers";
            {
                _y = _x;
                _PlyrUid  = getPlayerUID _y;
                _PlyrSID  = owner _y;
                _PlyrName = name _y;
                _PlyrPosi = position _y;
                _PlyrAliv = alive _y;
                _PlyrWeap = currentWeapon _y;
                _PlyrMony = _y getVariable ["ExileMoney", 0];
                _PlyrNotc = _y getVariable ["PVPSeenNotice"];
                _PlyrSafe = false;
                
                _PlyrX = _PlyrPosi select 0;
                _PlyrY = _PlyrPosi select 1;
                
                _rndm  = round(random [50, (PVPMMGV_mradius-50)/2, PVPMMGV_mradius]);
                _rndmX = _PlyrX + (_rndm * selectRandom [-1,1]);
                _rndm  = round(random [50, (PVPMMGV_mradius-50)/2, PVPMMGV_mradius]);
                _rndmY = _PlyrY + (_rndm * selectRandom [-1,1]);
                
                _PlyrinTerritory = _y call ExileClient_util_world_getTerritoryAtPosition;
                
                {
                    if (((_x select 0) distance2D _PlyrPosi) < (_x select 1)) exitWith
                    {
                        _PlyrSafe = true;
                    };
                } forEach ExileTraderZoneMarkerPositionsAndSize;
                
                if (getMarkerType _PlyrUid == "Empty") then {
                    _MarkerType = "updated";
                }else {
                    _MarkerType = "enabled";
                    
                };
                
                deleteMarker _PlyrUid;
                deleteMarker format["%1-brdr",_PlyrUid];
                deleteMarker format["%1-text",_PlyrUid];

                if ((_PlyrWeap != "") && (_PlyrAliv) && (vehicle _y == _y) && !(_PlyrSafe) && (isNull _PlyrinTerritory) && !(_PlyrUid in PVPMMGV_exclude)) then
                {
                    _markerstr = createMarker [_PlyrUid, [_rndmX, _rndmY]];
                    _markerstr setMarkerType "Empty";
                    _markerstr setMarkerShape "ELLIPSE";
                    _markerstr setMarkerColor "ColorBlue";
                    if (_PlyrMony >= 10000) then { _markerstr setMarkerColor "ColorYellow"; };
                    if (_PlyrMony >= 50000) then { _markerstr setMarkerColor "ColorGreen"; };
                    _markerstr setMarkerBrush "SolidBorder";
                    _markerstr setMarkerAlpha 0.25;
                    _markerstr setMarkerSize [PVPMMGV_mradius,PVPMMGV_mradius];
                    
                    _markerstr2 = createmarker [format["%1-brdr",_PlyrUid], [_rndmX, _rndmY]];
                    _markerstr2 setMarkerShape "ELLIPSE";
                    _markerstr2 setMarkerColor "ColorWhite";
                    _markerstr2 setMarkerBrush "Border";
                    _markerstr2 setMarkerSize [PVPMMGV_mradius,PVPMMGV_mradius];
        
                    _markerstr3 = createMarker [format["%1-text",_PlyrUid], [_rndmX, _rndmY]];
                    _markerstr3    setMarkerShape "ICON";
                    _markerstr3 setMarkerColor "ColorWhite";
                    
                    if !(PVPMMGV_mrkrico == "") then { _markerstr3 setMarkerType PVPMMGV_mrkrico; };
                    if !(PVPMMGV_mrkrtxt == "") then { _markerstr3 setMarkerText PVPMMGV_mrkrtxt; };
                    
                    if (_PlyrNotc != "active") then {
                        [_PlyrSID, "toastRequest", ["ErrorTitleOnly", ["PVP Marker Active!"]]] call ExileServer_system_network_send_to;
                        _y setVariable["PVPSeenNotice", "active"];
                    };
                    diag_log text format["[PVPMM]: Marker %1 for %2", _MarkerType, _PlyrName];
                }else {
                    _PVPreasons = [];
                    if (_PlyrWeap == "")                then { _PVPreasons pushBack "no weapon"; };    
                    if (_PlyrSafe)                      then { _PVPreasons pushBack "safe zone"; };
                    if !(_PlyrAliv)                        then { _PVPreasons pushBack "is dead"; };            
                    if (vehicle _y != _y)                 then { _PVPreasons pushBack "driving"; };             
                    if !(isNull _PlyrinTerritory)       then { _PVPreasons pushBack "in territory"; };
                    if (_PlyrUid in PVPMMGV_exclude)       then { _PVPreasons pushBack "is excluded"; };
                    _PVPreasons = _PVPreasons joinString ", ";
                    if (_PlyrNotc != "inactive") then {
                        [_PlyrSID, "toastRequest", ["SuccessTitleAndText", ["PVP Marker Inactive!",format["Because (%1)", _PVPreasons]]]] call ExileServer_system_network_send_to;
                        _y setVariable["PVPSeenNotice", "inactive"];
                    };
                    diag_log text format["[PVPMM]: Marker disabled for %1 because (%2)", _PlyrName, _PVPreasons];
                };
            } forEach _justPlayers;
        };
    }else {
        _justPlayers = allPlayers - entities "HeadlessClient_F";
        {
            _PlyrUid  = getPlayerUID _x;
            _PlyrSID  = owner _x;
            _PlyrName = name _x;
            _PlyrAliv = alive _x;
            if (!(_PlyrAliv) && (getMarkerType _PlyrUid == "Empty")) then
            {
                deleteMarker _PlyrUid;
                deleteMarker format["%1-brdr",_PlyrUid];
                deleteMarker format["%1-text",_PlyrUid];
                [_PlyrSID, "toastRequest", ["SuccessTitleOnly", ["PVP Marker Removed!"]]] call ExileServer_system_network_send_to;
                _y setVariable["PVPSeenNotice", "removed"];
                diag_log text format["[PVPMM]: Marker removed for %1 because (is dead)", _PlyrName];
            };
        } forEach _justPlayers;
    };
    _counter = _counter - 30;
};

Spoiler

/*
PVP Map Markers (Ducks of war version)
Created by Geekm0nkey for Arma 3 Exile.
Copyright 2018, Geekm0nkey, All rights reserved.
*/

private["_counter"];

// DO NOT EDIT BELOW THIS LINE!    
diag_log text "[PVPMM]: PVP map markers is active...";

/* All the functions */
fn_PVP_onJoin = {
    private["_id","_name","_uid","_justPlayers","_PlayerCount","_PlyrUid","_PlyrSID","_PlyrName","_PlyrPosi","_PlyrAliv","_PlyrWeap","_PlyrMony","_PlyrSafe","_PlyrX","_PlyrY","_rndm","_rndmX","_rndmY","_PlyrinTerritory","_markerstr","_markerstr2","_markerstr3","_PVPreasons"];
    
    _id     = _this select 0;
    _name     = _this select 1;
    _uid     = _this select 2;
    
    if (_name != "__SERVER__") then
    {
        uiSleep 10;
        _justPlayers = allPlayers - entities "HeadlessClient_F";
        
        if (count _justPlayers < PCPMMGV_minplay) then { _PlayerCount = "is not enough players" };
        if (count _justPlayers > PCPMMGV_maxplay) then { _PlayerCount = "is to many players" };
        
        if !(isNil "_PlayerCount") then {
            diag_log text format["[PVPMM]: Disabled because of player count (%1) %2", count _justPlayers, _PlayerCount];
        }else {
            diag_log text "[PVPMM]: PVP map markers adding new marker";
            {
                _y = _x;
                if (getPlayerUID _y == _uid) exitWith
                {
                    _PlyrUid  = getPlayerUID _y;
                    _PlyrSID  = owner _y;
                    _PlyrName = name _y;
                    _PlyrPosi = position _y;
                    _PlyrAliv = alive _y;
                    _PlyrWeap = currentWeapon _y;
                    _PlyrMony = _y getVariable ["ExileMoney", 0];
                    _PlyrSafe = false;
                    
                    _PlyrX = _PlyrPosi select 0;
                    _PlyrY = _PlyrPosi select 1;
                    
                    _rndm  = round(random [50, (PCPMMGV_mradius-50)/2, PCPMMGV_mradius]);
                    _rndmX = _PlyrX + (_rndm * selectRandom [-1,1]);
                    _rndm  = round(random [50, (PCPMMGV_mradius-50)/2, PCPMMGV_mradius]);
                    _rndmY = _PlyrY + (_rndm * selectRandom [-1,1]);
                    
                    _PlyrinTerritory = _y call ExileClient_util_world_getTerritoryAtPosition;
                    
                    {
                        if (((_x select 0) distance2D _PlyrPosi) < (_x select 1)) exitWith
                        {
                            _PlyrSafe = true;
                        };
                    } forEach ExileTraderZoneMarkerPositionsAndSize;
                    
                    if ((_PlyrAliv) && !(_PlyrSafe) && (isNull _PlyrinTerritory)  && !(_PlyrUid in PVPMMGV_exclude) && (("Exile_Item_RubberDuck" in (magazines _y)) || ("Exile_Item_RubberDuck" in (magazineCargo vehicle _y)))) then
                    {
                        _markerstr = createMarker [_PlyrUid, [_rndmX, _rndmY]];
                        _markerstr setMarkerType "Empty";
                        _markerstr setMarkerShape "ELLIPSE";
                        _markerstr setMarkerColor "ColorBlue";
                        if (_PlyrMony >= 10000) then { _markerstr setMarkerColor "ColorYellow"; };
                        if (_PlyrMony >= 50000) then { _markerstr setMarkerColor "ColorGreen"; };
                        _markerstr setMarkerBrush "SolidBorder";
                        _markerstr setMarkerAlpha 0.25;
                        _markerstr setMarkerSize [PCPMMGV_mradius,PCPMMGV_mradius];
                        
                        _markerstr2 = createmarker [format["%1-brdr",_PlyrUid], [_rndmX, _rndmY]];
                        _markerstr2 setMarkerShape "ELLIPSE";
                        _markerstr2 setMarkerColor "ColorWhite";
                        _markerstr2 setMarkerBrush "Border";
                        _markerstr2 setMarkerSize [PCPMMGV_mradius,PCPMMGV_mradius];
            
                        _markerstr3 = createMarker [format["%1-text",_PlyrUid], [_rndmX, _rndmY]];
                        _markerstr3    setMarkerShape "ICON";
                        _markerstr3 setMarkerColor "ColorWhite";
                        
                        if !(PCPMMGV_mrkrico == "") then { _markerstr3 setMarkerType PCPMMGV_mrkrico; };
                        if !(PCPMMGV_mrkrtxt == "") then { _markerstr3 setMarkerText PCPMMGV_mrkrtxt; };
                        
                        [_PlyrSID, "toastRequest", ["ErrorTitleOnly", ["PVP Marker Active!"]]] call ExileServer_system_network_send_to;
                        _y setVariable["PVPSeenNotice", "active"];
                        diag_log text format["[PVPMM]: Marker enabled for %1", _PlyrName];
                    }else {
                        _PVPreasons = [];
                        if !(("Exile_Item_RubberDuck" in (magazines _y)) || ("Exile_Item_RubberDuck" in (magazineCargo vehicle _y)))  then { _PVPreasons pushBack "not pvp'n"; };
                        if (_PlyrSafe)                      then { _PVPreasons pushBack "safe zone"; };                    
                        if !(_PlyrAliv)                     then { _PVPreasons pushBack "is dead"; };        
                        if !(isNull _PlyrinTerritory)       then { _PVPreasons pushBack "in territory"; };
                        if (_PlyrUid in PVPMMGV_exclude)       then { _PVPreasons pushBack "is excluded"; };
                        _PVPreasons = _PVPreasons joinString ", ";
                        [_PlyrSID, "toastRequest", ["SuccessTitleAndText", ["PVP Marker Inactive!",format["Because (%1)", _PVPreasons]]]] call ExileServer_system_network_send_to;
                        _y setVariable["PVPSeenNotice", "inactive"];
                        diag_log text format["[PVPMM]: Marker disabled for %1 because (%2)", _PlyrName, _PVPreasons];
                    };
                };
            } forEach _justPlayers;
        };
    };
};

fn_PVP_onPart = {
    
    private["_id","_name","_uid"];
    
    _id     = _this select 0;
    _name     = _this select 1;
    _uid     = _this select 2;
    
    deleteMarker _uid;
    deleteMarker format["%1-brdr",_uid];
    deleteMarker format["%1-text",_uid];
    diag_log text format["[PVPMM]: Marker removed for %1 (disconnected)", _name];
};
    
["PVPMMonJoinCall", "onPlayerConnected",      { [_id, _name, _uid] spawn fn_PVP_onJoin }] call BIS_fnc_addStackedEventHandler;
["PVPMMonPartCall", "onPlayerDisconnected",  { [_id, _name, _uid] call fn_PVP_onPart }] call BIS_fnc_addStackedEventHandler;

_counter = PCPMMGV_seconds;

while {true} do
{    
    private["_id","_name","_uid","_justPlayers","_PlayerCount","_PlyrUid","_PlyrSID","_PlyrName","_PlyrPosi","_PlyrAliv","_PlyrWeap","_PlyrMony","_PlyrNotc","_PlyrSafe","_PlyrX","_PlyrY","_rndm","_rndmX","_rndmY","_PlyrinTerritory","_MarkerType","_markerstr","_markerstr2","_markerstr3","_PVPreasons"];
    
    uiSleep 30;
    if (_counter <= 0) then
    {
        _counter = PCPMMGV_seconds;
        _justPlayers = allPlayers - entities "HeadlessClient_F";

        if (count _justPlayers < PCPMMGV_minplay) then { _PlayerCount = "is not enough players" };
        if (count _justPlayers > PCPMMGV_maxplay) then { _PlayerCount = "is to many players" };
        
        if !(isNil "_PlayerCount") then {
            diag_log text format["[PVPMM]: Disabled because of player count (%1) %2", count _justPlayers, _PlayerCount];
        }else {
            diag_log text "[PVPMM]: PVP map markers updating all markers";
            {
                _y = _x;
                _PlyrUid  = getPlayerUID _y;
                _PlyrSID  = owner _y;
                _PlyrName = name _y;
                _PlyrPosi = position _y;
                _PlyrAliv = alive _y;
                _PlyrWeap = currentWeapon _y;
                _PlyrMony = _y getVariable ["ExileMoney", 0];
                _PlyrNotc = _y getVariable ["PVPSeenNotice", ""];
                _PlyrSafe = false;
                
                _PlyrX = _PlyrPosi select 0;
                _PlyrY = _PlyrPosi select 1;
                
                _rndm  = round(random [50, (PCPMMGV_mradius-50)/2, PCPMMGV_mradius]);
                _rndmX = _PlyrX + (_rndm * selectRandom [-1,1]);
                _rndm  = round(random [50, (PCPMMGV_mradius-50)/2, PCPMMGV_mradius]);
                _rndmY = _PlyrY + (_rndm * selectRandom [-1,1]);
                
                _PlyrinTerritory = _y call ExileClient_util_world_getTerritoryAtPosition;
                
                {
                    if (((_x select 0) distance2D _PlyrPosi) < (_x select 1)) exitWith
                    {
                        _PlyrSafe = true;
                    };
                } forEach ExileTraderZoneMarkerPositionsAndSize;
                
                if (getMarkerType _PlyrUid == "Empty") then {
                    _MarkerType = "updated";
                }else {
                    _MarkerType = "enabled";
                    
                };
                
                deleteMarker _PlyrUid;
                deleteMarker format["%1-brdr",_PlyrUid];
                deleteMarker format["%1-text",_PlyrUid];

                if ((_PlyrAliv) && !(_PlyrSafe) && (isNull _PlyrinTerritory) && !(_PlyrUid in PVPMMGV_exclude) && (("Exile_Item_RubberDuck" in (magazines _y)) || ("Exile_Item_RubberDuck" in (magazineCargo vehicle _y)))) then
                {
                    _markerstr = createMarker [_PlyrUid, [_rndmX, _rndmY]];
                    _markerstr setMarkerType "Empty";
                    _markerstr setMarkerShape "ELLIPSE";
                    _markerstr setMarkerColor "ColorBlue";
                    if (_PlyrMony >= 10000) then { _markerstr setMarkerColor "ColorYellow"; };
                    if (_PlyrMony >= 50000) then { _markerstr setMarkerColor "ColorGreen"; };
                    _markerstr setMarkerBrush "SolidBorder";
                    _markerstr setMarkerAlpha 0.25;
                    _markerstr setMarkerSize [PCPMMGV_mradius,PCPMMGV_mradius];
                    
                    _markerstr2 = createmarker [format["%1-brdr",_PlyrUid], [_rndmX, _rndmY]];
                    _markerstr2 setMarkerShape "ELLIPSE";
                    _markerstr2 setMarkerColor "ColorWhite";
                    _markerstr2 setMarkerBrush "Border";
                    _markerstr2 setMarkerSize [PCPMMGV_mradius,PCPMMGV_mradius];
        
                    _markerstr3 = createMarker [format["%1-text",_PlyrUid], [_rndmX, _rndmY]];
                    _markerstr3    setMarkerShape "ICON";
                    _markerstr3 setMarkerColor "ColorWhite";
                    
                    if !(PCPMMGV_mrkrico == "") then { _markerstr3 setMarkerType PCPMMGV_mrkrico; };
                    if !(PCPMMGV_mrkrtxt == "") then { _markerstr3 setMarkerText PCPMMGV_mrkrtxt; };
                    
                    if (_PlyrNotc != "active") then {
                        [_PlyrSID, "toastRequest", ["ErrorTitleOnly", ["PVP Marker Active!"]]] call ExileServer_system_network_send_to;
                        _y setVariable["PVPSeenNotice", "active"];
                    };
                    diag_log text format["[PVPMM]: Marker %1 for %2", _MarkerType, _PlyrName];
                }else {
                    _PVPreasons = [];
                    if !(("Exile_Item_RubberDuck" in (magazines _y)) || ("Exile_Item_RubberDuck" in (magazineCargo vehicle _y)))  then { _PVPreasons pushBack "not pvp'n"; };
                    if (_PlyrSafe)                      then { _PVPreasons pushBack "safe zone"; };
                    if !(_PlyrAliv)                     then { _PVPreasons pushBack "is dead"; };             
                    if !(isNull _PlyrinTerritory)       then { _PVPreasons pushBack "in territory"; };
                    if (_PlyrUid in PVPMMGV_exclude)       then { _PVPreasons pushBack "is excluded"; };
                    _PVPreasons = _PVPreasons joinString ", ";
                    if (_PlyrNotc != "inactive") then {
                        [_PlyrSID, "toastRequest", ["SuccessTitleAndText", ["PVP Marker Inactive!",format["Because (%1)", _PVPreasons]]]] call ExileServer_system_network_send_to;
                        _y setVariable["PVPSeenNotice", "inactive"];
                    };
                    diag_log text format["[PVPMM]: Marker disabled for %1 because (%2)", _PlyrName, _PVPreasons];
                };
            } forEach _justPlayers;
        };
    }else {
        _justPlayers = allPlayers - entities "HeadlessClient_F";
        {
            _PlyrUid  = getPlayerUID _x;
            _PlyrSID  = owner _x;
            _PlyrName = name _x;
            _PlyrAliv = alive _x;
            if (!(_PlyrAliv) && (getMarkerType _PlyrUid == "Empty")) then
            {
                deleteMarker _PlyrUid;
                deleteMarker format["%1-brdr",_PlyrUid];
                deleteMarker format["%1-text",_PlyrUid];
                [_PlyrSID, "toastRequest", ["SuccessTitleOnly", ["PVP Marker Removed!"]]] call ExileServer_system_network_send_to;
                _x setVariable["PVPSeenNotice", "removed"];
                diag_log text format["[PVPMM]: Marker removed for %1 because (is dead)", _PlyrName];
            };
        } forEach _justPlayers;
    };
    _counter = _counter - 30;
};

UPDATE #1:

  • Added some RPT  logging.

UPDATE #2:

  • New user markers are created 10 seconds after connection.
  • Markers are removed immediately upon disconnect.
  • Markers are removed 30 seconds after death.
  • Lots of logging to RPT for those who like logs.
  • Added config.sqf for user options.
  • User customize-able delay and radius for the markers (see config.sqf file)
  • User customize-able minimum and maximum player online trigger.

UPDATE #3:

  • Adjustable marker icon.
  • Adjustable marker text.
  • Change math that is used to calculate random placement of marker.
  • Added toast messages to let players know when they are marked.

UPDATE #4:

  • Added a ducks of war version, changes are... Update marker every 30 seconds, must have a duck on person or in vehicle they are in. Otherwise they will not be marked.
  • Goes without saying, you need to have Ducks of War installed and working before this version will work.

UPDATE #5:

  • Added ability to exclude players from being marked.

 

FUTURE?

  • Someone suggested I modify the code, to create a marker only when you have fired a weapon, and make it last say only for 2.5 minutes, or until you fire again..
  • Add code to activate markers only when a minimum and maximum number of players are online. ADDED!
Edited by geekm0nkey
  • Like 7

Share this post


Link to post
Share on other sites
Advertisement

So, after hours and hours and hours.. I finally have a much more robust version to offer.. See the OP for update details..  And no stokes, didn't convert to Try/Catch as the If/Then seems to work just fine.. Lol.

Share this post


Link to post
Share on other sites

Ok, so this is pretty much done, no more glitches, seems stable, notifications work (and have limits as to not spam players) Log entries are clean and efficient.  So on to the important question... Is this mod to OP, ESP whatever the kids are saying these days?  I had a few players come on and yesterday and immediately started complaining. So I'm looking for feedback opinions, suggestions to improve...

Thanks.

Share this post


Link to post
Share on other sites

Love the script @geekm0nkey reminds me of the Wasteland "High Value Target" script.

I changed it so you have to carry money for it to activate markers:
markers.sqf

Spoiler

                        if (_PlyrMony >= 10000) then { _markerstr setMarkerColor "ColorBlue"; };
                        if (_PlyrMony >= 50000) then { _markerstr setMarkerColor "ColorYellow"; };
                        if (_PlyrMony >= 100000) then { _markerstr setMarkerColor "ColorRed"; };

If I change:
                _PlyrWeap = currentWeapon _y;

to
                _PlyrWeap = primaryWeapon _y;

Will that make it if you are carrying a primary gun the markers activate?

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.