Kill messages 1.8.2?

LTGNick

Valued Member!
I was on a server called Dystopia 1 and when i was on it i noticed it had kill messages on the top left side of the screen ... how might one can i make those appear on my server?
 
You have to be patient .. I will get to it LOL
They are dialogs. Create a dialog and fill in the data using ctrlsettext and the OnLoad function of the frame ...
I am in the middle of placing 300 vehicle spawns in appropriate locations on Lingor Island, will done with it tommorrow and then we can get to this.
 
This is sort of what you want it to look like?

DKLZ5l2.png
 
@ShootingBlanks Yes one like that would work pretty well i wouldent imagine you would know how to add in the distance the weapon was shot from to see? i dont need it but i would believe it would be nice to know if some shots can be legit or not
 
of course I do.
that is just a mock up to demonstrate to those who havent seen those deathmeassages what they look like.
I was thinking of a layout like

shootingblanks killed ltgnick
with large penis from 1 m

btw .. large penis is headshots only


or I like this format

killer killed victim
Weapon: Banana gun
Distance: 154m
 
Last edited:
I am working on adding this into my Dayzeta Alien Invasion mod to be released next week so when I get it, you will get it.
I am also going to remove the debug monitor and incorporate the debug monitor info, the last kill info and the help page into my help dialog. hopefully tonight but am.still placing vehicles and that is time consuming.
 
I am going to say this is working. There is a video showing it working with the Text Only format. I will show you how to change the background to look like the semi-transparent box I showed a few posts above (or change it to any color you want to match your server).
I did NOT test with real players. I tested by running a code on the server that 'simulated' a player kill and it broadcast that information to all clients (myself). So there could be an error in the server_playerdied.sqf file but I doubt it. I don't have any friends to test this with ... :(
DO NOT let me forget to package this all up and upload it to the resources folder so its available on opendayz.net along with the instructions.
Here are the files you need and a install readme. I pasted the readme at the bottom of this post. I am sure its all confusing and written in an unclear manner but I am here to answer your questions.
http://iaregameplayer.com/files/public/dayz/deathmessages.zip

There are two hpp files included. You have to #include ONE of them in your description.ext file.
If you do NOT have a class RSCTITLES line then at the top of your file you can
#include "dm_display.hpp"
If you DO have class RSCTITLES (and you definately DO if you have the watermark enabled) then right below the class RscTitles { line add this
#include "dm_display_rsctitle.hpp"


dayz_server/init/server_functions.sqf
add
Code:
    fnc_plyrHit   = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fnc_plyrHit.sqf";
I think i forgot to add this file into the zip. Download it and place in dayz_server/compiles
http://dayz.st/w/community_files/Fnc_plyrHit.zip

add into dayz_server/compiles/player_setup.sqf
right below
if (isNull _playerObj) exitWith {
diag_log ("SETUP INIT FAILED: Exiting, player object null: " + str(_playerObj));
};
Code:
_playerObj addMPEventHandler ["MPHit", {_this spawn fnc_plyrHit;}];

dayz_server/compiles/server_playerdied.sqf
right below _playerName = name _newObject;
add this
Code:
//---------------------------------------- DEATH MESSAGES --------------------------------------------
_victim removeAllEventHandlers "MPHit";

_victim = _this select 2;
_victimName = _playerName;

_killer = _victim getVariable["AttackedBy", "nil"];
_killerName = _victim getVariable["AttackedByName", "nil"];

// when a zombie kills a player _killer, _killerName and _weapon will be "nil"
// we can use this to determine a zombie kill and send a customized message for that. right now no killmsg means it was a zombie.
if (_killerName != "nil") then
{
    _weapon = _victim getVariable["AttackedByWeapon", "nil"];
    _distance = _victim getVariable["AttackedFromDistance", "nil"];


     _loc_message = format["PKILL: %1 (%5) was killed by %2 (%6) with weapon %3 from %4m", _victimName, _killerName, _weapon, _distance, _playerID,         _killerPlayerID];
    diag_log _loc_message;
    death_message = format["%1 killed %2\nWeapon: %3\nDistance: %4",_killername,_victim,_weapon,_distance];
    // show death_message locally
    5 cutRsc ["dm_disp","PLAIN"];
    ((uiNamespace getVariable "dm_control") displayCtrl 1) ctrlSetText death_message;
    //show deathmessage globally
    publicVariable "death_message";

    _victim setVariable["Killedby", _killername, true];
    _victim setVariable["Killedwith", _weapon, true];
    _victim setVariable["KilledDistance", _distance, true];

    // Cleanup
    _victim setVariable["AttackedBy", "nil", true];
    _victim setVariable["AttackedByName", "nil", true];
    _victim setVariable["AttackedByWeapon", "nil", true];
    _victim setVariable["AttackedFromDistance", "nil", true];

};
// -----------------------------------------------------------------------------------------------------------

mpmission/init.sqf
add this to the bottom of your init.sqf file
Code:
if (!isServer) then {
    "death_message" addPublicVariableEventHandler {
        5 cutRsc ["dm_disp","PLAIN"];
        ((uiNamespace getVariable "dm_control") displayCtrl 1) ctrlSetText death_message;
        };
};

mpmission/description.ext
If your do NOT already have a line class rsctitles then add this to the top of your file.
Code:
#include "dm_display.hpp"

If you DO have a line class rsctitle then add this INSIDE the rsctitle code block at the top
so it looks like this
// logo watermark
class RscTitles {
#include "scripts\dm_display_rsctitle.hpp"
class wm_disp {
Code:
#include "dm_display_rsctitle.hpp"

Copy dm_display.hpp and or dm_display_rsctitle.hpp to your mpmission folder. If you put it in a subfolder then change the path in
the #include line
 
Last edited:
To change the background to the semi transparent color open the dm_display.hpp file you are using and look for this line
Code:
                colorBackground[] = { 1, 0.3, 0, 0 };  // uncomment and increase 4th number to have a background
What you have there is an array of colors and transparency in a scale from 0 to 1.
colorBackground[] = { RED,BLUE,GREEN,TRANSPARENCY };

Examples
here is a pretty orange background

colorBackground[] = { 1, .5, 0, .5 };
If you use the normal rgb color codes you have to translate the 0 to 255 value into a 0-1 value. So here we have
full red, half green, no blue and its set to 50% transparency.
The dark background like we used a few posts up would be
colorBackground[] = { 0,0, 0, .5 };
which is black (#000000) with 50% transparency.

You can change the text color the same way by editing the attributes color line.
color = "#ffffff";

I gave the box some extra space to accomodate longer names and it has an extra line at the bottom because if the names are tooooo long they will wrap to the next line. So tell anyone with a name longer than 20 characters they can only kill players with names shorter than 20 characters ... or deal with the word wrap. the weapon and distance should not exceed the available width.

37kBicN.png
 
Having some issues. Now the client gets stuck on loading screen. No errors.

Assuming it is a battleye script. Removing them all for now.
 
Back
Top