geekm0nkey

[Release] PVP Map Markers

23 posts in this topic

30 minutes ago, aussie battler said:

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

  Hide contents

                        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?

You can try it, back when I made this i think that only returns the name, even if slung.. I wanted to be the active weapon in hand..

Share this post


Link to post
Share on other sites
Advertisement

@geekm0nkey What part of markers.sqf would I need to edit to remove the first blue marker (no money on player).

I would like to make markers only active when players carry cash + gun.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I think this might do the trick:
                    if ((_PlyrWeap != "") && (_PlyrMony >= 10000) && (_PlyrAliv) && (vehicle _y == _y) && !(_PlyrSafe) && (isNull _PlyrinTerritory)) then 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Comfirmed that the above code works if you only want PVP markers when players carry a certain amount of poptabs. 

Edited by aussie battler
  • Like 1

Share this post


Link to post
Share on other sites

@Falcon911

I made the markers to only appear when a player carries poptabs & they must have a primary weapon on them (in hands, on their back or in the backpack).

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 < 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 = PrimaryWeapon _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 ((_PlyrWeap != "") && (_PlyrMony >= 10000) && (_PlyrAliv) && (vehicle _y == _y) && !(_PlyrSafe) && (isNull _PlyrinTerritory)) then
                    {
                        _markerstr = createMarker [_PlyrUid, [_rndmX, _rndmY]];
                        _markerstr setMarkerType "Empty";
                        _markerstr setMarkerShape "ELLIPSE";
                        if (_PlyrMony >= 10000) then { _markerstr setMarkerColor "ColorGreen"; };
                        if (_PlyrMony >= 50000) then { _markerstr setMarkerColor "ColorYellow"; };
                        if (_PlyrMony >= 100000) then { _markerstr setMarkerColor "ColorRed"; };
                        _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 (_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 (_PlyrMony <= 10000) then { _PVPreasons pushBack "no poptabs"; };
                        _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 = PrimaryWeapon _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 ((_PlyrWeap != "") && (_PlyrMony >= 10000) && (_PlyrAliv) && (vehicle _y == _y) && !(_PlyrSafe) && (isNull _PlyrinTerritory)) then
                {
                    _markerstr = createMarker [_PlyrUid, [_rndmX, _rndmY]];
                    _markerstr setMarkerType "Empty";
                    _markerstr setMarkerShape "ELLIPSE";
                        if (_PlyrMony >= 10000) then { _markerstr setMarkerColor "ColorGreen"; };
                        if (_PlyrMony >= 50000) then { _markerstr setMarkerColor "ColorYellow"; };
                        if (_PlyrMony >= 100000) then { _markerstr setMarkerColor "ColorRed"; };
                    _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 (_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 (_PlyrMony <= 10000) then { _PVPreasons pushBack "no poptabs"; };                    
                    _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;
};


 

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.