Jump to content

Name Tag for PvE - on map & screen


Schalldampfer

Recommended Posts

This script creates name tag on screen and on map for everyone (else than yourself and your group members) in the server.

In vanilla DZE, You can see the marker of your position by setting
dayz_markSelf = 2;
and the markers and name tags of your group members by
dayz_markGroup = 1;
, and you can see name tag of other people when you aim him properly (and maybe, you need to DETECT him) - sometime not working  and "blue on bllue" happens in a PvE server.
I don't know how to "always" show name tags for other people in the server, so I have created this

Edit 2017/5/12: New version which shows EVERY player - old script shows only team leaders

Install:

1.Create DayZ_Epoch_11.Chernarus\Custom\showplayer.sqf  which includes below;

Spoiler

private ["_isDisplay","_hasGPS","_hasRadio","_vehname","_index","_players","_count","_unitGroup","_isLeader","_veh","_inVeh","_distance"];
disableSerialization;

if (isDedicated) exitWith {};

while {!(player getVariable ["DZE_display_name", false])} do {sleep 5;};

_players = [];
_count = 0;
setGroupIconsVisible [false,true];

while {true} do {
    //delete marker
    for "_index" from 0 to (_count - 1) do {
        deleteMarkerLocal format["playerMarker%1",_index];
    };
    {clearGroupIcons group _x;} forEach _players;

    //initialize
    _isDisplay = player getVariable ["DZE_display_name", false];
    _hasGPS = ("ItemGPS" in items player) || (dayz_markGroup == 1);
    _hasRadio = ("ItemRadio" in items player) || !dayz_requireRadio;
    _count = 0;
    _players = [];

    if (_isDisplay && _hasRadio && _hasGPS) then {
        //set player list
        {
            if ((alive _x) && !(_x in (units group player)) && (effectiveCommander (vehicle _x) == _x) && !(_x in _players)) then {
                _players set [count _players,_x];
            };
        } forEach playableUnits;
        _count = count _players;

        //create marker
        {
            //initialize
            _veh = vehicle _x;
            _unitGroup = group _x;
            _inVeh = (_veh == _x);
            _isLeader = (_x == leader _unitGroup);
            _distance = player distance _x;
            
            // Set group name
            if (_inVeh) then {
                _vehname = name _x;
            } else {
                // Get vehicle name
                _vehname = gettext (configFile >> 'CfgVehicles' >> (typeof _veh) >> 'displayName');
                // Get crew names
                {
                    _vehname = _vehname + ", " + (name _x);
                } forEach (crew _veh);
            };
            _vehname = format ["[%1]@%2m",_vehname,round(_distance)];

            // Add Marker
            _marker = createMarkerLocal [format["playerMarker%1",_forEachIndex],getpos _x];
            if (_inVeh) then {
                _marker setMarkerTypeLocal "b_inf";
                if (_isLeader) then {
                    _unitGroup addGroupIcon ["b_inf"];
                };
            } else {
                _marker setMarkerTypeLocal "b_motor_inf";
                if (_isLeader) then {
                    _unitGroup addGroupIcon ["b_motor_inf"];
                };
            };
            _marker setMarkerTextLocal _vehname;
            _marker setMarkerColorLocal "ColorGreen";
            if (_isLeader) then {
                _unitGroup setGroupIconParams [[0,1,0,1], _vehname, 0.35, (_distance < DZE_HumanityTargetDistance)];
            };
        } forEach _players;
    };

    sleep 5;
};
 

 

2. in the bottom (or, maybe, in the if (!isDedicated) then { *** }; section) of DayZ_Epoch_11.Chernarus\init.sqf, add

Spoiler

//Player tag
[] execVM "Custom\showplayer.sqf";

and also in init.sqf,
DZE_NameTags must be 1 or 2(and select "Display Name (Yes)" in game) to use this script.
You need to have a Radio and a GPS.

Optional:
dayz_markGroup = 1; makes the script not to require a GPS.
dayz_requireRadio = false; makes the script not to require a Radio.

This script is based on ESPplayer of Admin tool

Spoiler
On 2/19/2014 at 10:52 AM, NoxSicarius said:

NOTICE For those who want to use this in 1.0.6

The tools are partially updated for the new release. Most features are working so far and it can be downloaded from here (follow the readme for install): https://github.com/noxsicarius/Epoch-Admin-Tools/tree/TestBranch

j0bTHPB.png

 

 

IMPORTANT:

Under NO circumstances should you download this tool from a different source. I have been notified of numerous virus downloads listed as my work (usually second page of google and farther). I have petitioned to have all of the ones I know of blacklisted and have sent virus profiles to all major antivirus companies. If you find a .exe in any work claiming to be mine, it is a virus and should be shredded. 

Please only download from MY github link or the links in this post.

My github repo will NEVER be removed and if I leave the project and someone wishes to take over, they will be given rights to the repo.

 

Features:
 
For help with Administration:

  • Multiple Admin levels
  • Spectate players
  • "Display code" for locked vaults/doors
  • "Create key" for vehicles with lost keys
  • Force lock and unlock vehicles without keys
  • Base Destruction - Destroy all buildables/vehicles within a customizable radius
  • Spawnable crates with weapons, items, and supplies
  • Spawn locked or temporary vehicles via the menu or a custom-made graphical vehicle menu (screenshot)

Other features:

  • Godmode
  • Teleport self (or others to you)
  • Flying
  • Invisibility
  • Delete and repair/refuel vehicle on crosshairs
  • ESP - display players, zombies, safes, tents, vehicles, and AI on the map
  • ...and more!

Installation, changes, additional information, FAQ, credits, issues and everything else can be found at the project page on Github:

Epoch Admin Tools on GitHub

Click here for an install tutorial video for the tool

I have been informed that some places block GitHub, so here are direct links hosted by me:

Newest full release: https://www.dropbox.com/s/pjvj07u5yemo7we/Epoch-Admin-Tools-master.zip?dl=0
Beta build: https://www.dropbox.com/s/xm6t1k3gvp3t8ex/Epoch-Admin-Tools-TestBranch.zip?dl=0


If you have an improvement you would like to add, make a pull request and make these tools even better!


Error Reporting:
 
BEFORE posting an issue on Github or on this forum:

  • If you think you might have installed it incorrectly, follow the YouTube Video Install Tutorial
  • Try reinstalling the tool. You more than likely missed something important.
  • Do a quick search on this forum for a fix to your problem.
  • Check your server's RPT log for errors. This will identify 99% of problems with the menu. Be ready to copy/paste the RPT log into Pastebin or Gist in an issue or in the discussion forum for help with troubleshooting.

If your problem persists after doing the above:

  • Open your arma2oaserver.rpt file in a text editor and copy/paste the RPT log into Pastebin and post your issue in this forum with the rpt log. If you post something like "It doesn't work" I will not acknowledge you. Not giving all possible details in the first post simply makes it take longer to resolve and will waste everyone's time. I am hard pressed for time these days so if you won't take the initiative to provide information, I won't ask for it either. I am not trying to be mean, but I am quite tired of getting 5 or less word posts that provide no information other than this person has some kind of problem somewhere on their server that may or may not be related to this mod.
  • If the problem you are posting is a bug and not a general install problem then post it to this forum AND to the github issues page.

 

I have been asked by someone if they can donate to the project so I am adding the link here.
 
 

I have invested a good deal of time into this so if you find it useful please give a little donation.

(DONATE)

I also accept Crypto Currency: 

Bitcoin: 1GkzMzwnVwVpnUCVFaAyLDsgD9cqSfigdm

Litecoin: LbUrUxXzA557VeTWXM8jP7hNf3uZHEqW5b

 

A sincere thanks to those who made a monetary contribution to this project.: calamityCRHASHBMovieQueenzixxel, 8BitSigdomAnariorf3cukCaveman1, Nathan, [member=WootyWoop], [member=Terrance Smith]

 

Please leave your name in a note if you donate so that I can list you above.

 

To Block damage by PvP, try:

On 8/29/2017 at 4:09 AM, salival said:

You could do it in the damage handler around here: https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_code/compile/fn_damageHandler.sqf#L77


if (_isPlayer) exitWith {};

Should be enough to exit it if a player shoots/damages another player.

Not tested but don't see why it wouldn't work.

Edited by Schalldampfer
Update
Link to comment
Share on other sites

1 hour ago, kingpapawawa said:

looking to add a right click option on gps to turn this off and on... have tried doing it myself and failed miserably =)

In the show_player.sqf find this line:

while {true} do {

And replace it with

while {DZE_showplayers} do {

Then go to your rightclick actions and link the item you want to use to a script, something like toggle_showplayer.sqf (that's your choice) and then in this script simply write:

if (DZE_showplayers) then {
	DZE_showplayers = false;
} else {
	DZE_showplayers = true;
};

done

Link to comment
Share on other sites

2 minutes ago, kingpapawawa said:

  Error Undefined variable in expression: dze_showplayers

You have to define it somewhere ofcourse :D
For example in the init.sqf or the variables.sqf so it has a default value. I thought this is self explainatory, sorry.

Link to comment
Share on other sites

10 minutes ago, kingpapawawa said:

some of us are idiots =)

Wow, that's not what I meant. I just forgot to add this to my instruction because for me it was simple but that's the difference between guys that install scripts from this forum and the guys that write them. :D
That doesn't mean you are an idiot. :b

Link to comment
Share on other sites

DZE_NameTags is in \z\addons\dayz_code\configVariables.sqf

Spoiler

DZE_NameTags = 0; // Name displays when looking at player up close  0 = Off, 1= On, 2 = Player choice

if you set DZE_NameTags, DZE_display_name will be set in \z\addons\dayz_code\actions\display_name.sqf automatically.
In my script, I'm using DZE_display_name to show tags or not. Touching DZE_NameTags is the way to set DZE_display_name.

DZE_showplayers is a new variable that's added by @DAmNRelentless ,which is not in my version at all.

Link to comment
Share on other sites

7 hours ago, Schalldampfer said:

DZE_showplayers is a new variable that's added by @DAmNRelentless ,which is not in my version at all.

That was just an idea for the name of the variable because your script was named showplayers.sqf.
The idea was to make this available for right click options so you can toggle your script. :)

Link to comment
Share on other sites

  • 4 months later...

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...