Jump to content

[RELEASE] Client Map Markers With Player Names


Gr8

Recommended Posts

Map Marker With Player Names

 

Anybody who puts a Map Marker on the map, it shows the name of the player. This Prevents abuse of spamming map with markers

zfnhYuj.png

 

Create a file called GG_MapMarker.sqf in a folder called custom in your mission file.

 

Paste this inside the GG_MapMarker.sqf

// =============================================================================
// | GG_MapMarker.sqf [1.0]                                                |
// | Script adds player name to the created map marker                         |
// | by Prodavec, thanks to Gunter Severloh, PvPscene, Maca               |
// =============================================================================

// ====================================
// | INCLUDES                         |
// ====================================

// ====================================
// | DEFINITIONS                      |
// ====================================
//#define     MMT_DEBUG

#define     MMT_DIK_ESC                 1
#define     MMT_DIK_ENTER               28
#define     MMT_DIK_KPENTER             156
#define     MMT_SEARCHTIME              2
#define     MMT_DISPLAY_MAP             12
#define     MMT_DISPLAY_MARKER          54
#define     MMT_CONTROL_MAP             51
#define     MMT_CONTROL_MARKER          101

// ====================================
// | PRE-INIT                         |
// ====================================

// ====================================
// | VARIABLES                        |
// ====================================

// ====================================
// | FUNCTIONS                        |
// ====================================
fnc_marker_keyUp_EH = {
    private ["_handled", "_display", "_dikCode", "_control", "_text"];
    _display = _this select 0;
    _dikCode = _this select 1;
    _handled = false;
	
    if ((_dikCode == MMT_DIK_ENTER) || (_dikCode == MMT_DIK_KPENTER)) then {
        _control = _display displayCtrl MMT_CONTROL_MARKER;
        _text = ctrlText _control;
        if (_text == "") then {
            _text = format ["%1", name player];
        } else {
            _text = format ["%1: %2", name player, _text];
        };
        _control ctrlSetText _text;
        _display displayRemoveAllEventHandlers "keyUp";
        _display displayRemoveAllEventHandlers "keyDown";
    };

    _handled;
};

fnc_marker_keyDown_EH = {
    private ["_handled", "_display", "_dikCode"];
    _display = _this select 0;
    _dikCode = _this select 1;
    _handled = false;

    if (_dikCode == MMT_DIK_ESC) then {
        _display displayRemoveAllEventHandlers "keyUp";
        _display displayRemoveAllEventHandlers "keyDown";
    };

    _handled;
};

fnc_map_mouseButtonDblClick_EH = {
    private ["_display"];

    disableUserInput true; // Scheduled environment

    (time + MMT_SEARCHTIME) spawn {
        disableSerialization;

        while {time < _this} do {
            _display = findDisplay MMT_DISPLAY_MARKER;
            if !(isNull _display) exitWith {
                _display displayAddEventHandler ["keyUp", "_this call fnc_marker_keyUp_EH"];
                _display displayAddEventHandler ["keyDown", "_this call fnc_marker_keyDown_EH"];
            };
        };
        disableUserInput false;
    };
    true;
};

// ====================================
// | MAIN                             |
// ====================================
waitUntil {sleep 0.1; !isNull (findDisplay MMT_DISPLAY_MAP)};
((findDisplay MMT_DISPLAY_MAP) displayCtrl MMT_CONTROL_MAP) ctrlAddEventHandler ["mouseButtonDblClick", "call fnc_map_mouseButtonDblClick_EH"];

In your Init.sqf

 

Find this code:

if (!isDedicated) then { };

add this before the };

execVM "custom\GG_MapMarker.sqf";

Credits:

Prodavec

Maca

Gunter Severloh

PvPscene

Link to comment
Share on other sites

So basically you changed the name of the script and added your name to the thanks to to a script that was leaked from Maca's GitHub, good job!

 

It clearly says who its made by, and no its not leaked, its been shared to the community in many posts

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
  • 1 month later...

In your Init.sqf

 

add this to the very bottom:

execVM "custom\GG_MapMarker.sqf";

 

if you add this to the buttom of the init it will start on the server aswell, it should be added within this block:

if (!isDedicated) then {

or you can add this in the script:

if (isServer)exitWith{};

How make log, who delete markers? 

help pls!?

 

you would have to use a public vairable and send it to the server, else it will be logged on the client (wich is irrelevant)

Link to comment
Share on other sites

  • 3 months later...

Try it on A3 epoch. Might work :)

 

Seems to be working.

 

Added.....

 

waitUntil {!isNuLL(uiNameSpace getVariable ["EPOCH_loadingScreen",displayNull])};

waitUntil {isNuLL(uiNameSpace getVariable ["EPOCH_loadingScreen",displayNull])};

 

..at the top.  Not sure if its needed but script is working.  Relogged, checked map functions/menus and clicks in all channels, seems normal. Cool lil script, many thanks Gr8!

Link to comment
Share on other sites

Seems to be working.

 

Added.....

 

waitUntil {!isNuLL(uiNameSpace getVariable ["EPOCH_loadingScreen",displayNull])};

waitUntil {isNuLL(uiNameSpace getVariable ["EPOCH_loadingScreen",displayNull])};

 

..at the top.  Not sure if its needed but script is working.  Relogged, checked map functions/menus and clicks in all channels, seems normal. Cool lil script, many thanks Gr8!

 

Great News, But Gr8's Banned so he cant edit the post to add the A3 Info. I will try it on my A3 Server. 

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 2 months later...
  • 6 months later...

I really want this script to work, have trouble with people marking like crazy on the map but Im afraid to break my infistar.

Could anyone be nice to explain how to change in infistar for it to work?

Its an arma 2 dayz server I want it to work on...

Link to comment
Share on other sites

On 5/15/2016 at 5:16 PM, JonasF said:

I really want this script to work, have trouble with people marking like crazy on the map but Im afraid to break my infistar.

Could anyone be nice to explain how to change in infistar for it to work?

Its an arma 2 dayz server I want it to work on...

just make a backup of your infistar files that you plan to edit before editing them.

Link to comment
Share on other sites

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
  • Discord

×
×
  • Create New...