1.8.7 Kill Messages?

HospitalChair

Well-Known Member
I was wondering if anyone had an update for this last patch (Dayzmod cherno 1.8.7). I attempted to use my old script taking from this:

http://opendayz.net/threads/kill-messages-1-8-2.20957/

I had a scripter tweak it for 1.8.6.1 for me but he has since disappeared on me and i havent been able to debug. This is one of the few scripts that my players are desperately wanting and I'm willing to compensate someone for their time.

Thanks
 

Inkko

OpenDayZ Rockstar!
I was wondering if anyone had an update for this last patch (Dayzmod cherno 1.8.7). I attempted to use my old script taking from this:

http://opendayz.net/threads/kill-messages-1-8-2.20957/

I had a scripter tweak it for 1.8.6.1 for me but he has since disappeared on me and i havent been able to debug. This is one of the few scripts that my players are desperately wanting and I'm willing to compensate someone for their time.

Thanks

I have my own kill messages that I made cause I couldn't get any other variants to work. It's a lil buggy but seems to work fairly well most of the time.
 

Inkko

OpenDayZ Rockstar!
Can probably update mine to have weapon images or improve the look of it but this is what I threw together.

Server Side:

server_monitor.sqf at the very bottom change the PVDZ_sec_atp PVEH to this:
Code:
"PVDZ_sec_atp" addPublicVariableEventHandler {
    _x = _this select 1;
    switch (1==1) do {
        case (typeName _x == "STRING") : { // just some logs from the client
            diag_log _x;
        };
        case (count _x == 2) : { // wrong side
            diag_log Format [ "P1ayer %1 reports possible 'side' hack... Server may be comprised!", (_x select 1) call fa_plr2Str ];
        };
        default { // player hit
            _unit = _x select 0;
            _source = _x select 1;
            if (((!(isNil {_source})) AND {(!(isNull _source))}) AND {((_source isKindOf "CAManBase") AND {(owner _unit != owner _source)})}) then {
                diag_log format ["P1ayer %1 hit by %2 %3 from %4 meters",
                    _unit call fa_plr2Str,  _source call fa_plr2Str, _x select 2, _x select 3];
                if (_unit getVariable["processedDeath", 0] == 0) then {
                    _weapon = (currentWeapon _source);
                    _weapon_dmg = gettext (configFile >> 'cfgWeapons' >> _weapon >> 'displayName');
                    _distance = round (_unit distance _source);
                    _unit setVariable ["AttackedByWeapon", _weapon_dmg, true];
                    _unit setVariable ["AttackedFromDistance", _distance, true];
                    _anonstat = _source getVariable "Anon";
                    if (isnil "_anonstat") then {
                    _anonstat = false;
                    };
                    if (!_anonstat) then {
                    _unit setVariable ["attacker", name _source ];
                    } else {
                    _unit setVariable ["attacker", "Anonymous" ];
                    };
                    _unit setVariable [ "noatlf4", diag_ticktime ]; // server-side "not in combat" test, if player is not already dead
                };
            };
        };
    };
};

At the very bottom of server_playerDied.sqf add this:
Code:
[_newObject] spawn {
    _unit = _this select 0;

    waituntil {!isnil {_unit getVariable "attacker"}};
    _attacker = _unit getVariable "attacker";
    _attackedby = _unit getVariable "AttackedByWeapon";
    _attackdistance = _unit getVariable "AttackedFromDistance";
    //_attacker = _unit getVariable "AttackedByWeaponImg";
    _unitname = name _unit;
    if (isnil "_attackedby") then {
    _message = format["%1 killed by %2 from [%3m]", _unitname, _attacker, _attackdistance];
    CustomMessage = _message;
    } else {
    _message = format["%1 killed by %2 with %3 from [%4m]", _unitname, _attacker, _attackedby, _attackdistance];
    CustomMessage = _message;
    };
    diag_log format["%1",CustomMessage];
    publicVariable "CustomMessage";
};

client side:

client sided publicEH.sqf required but can probably stick this somewhere else.

in publicEH.sqf in the "if (!isDedicated) then {" code chunk add this:
Code:
"CustomMessage" addPublicVariableEventHandler {
        _finaltxt = (_this select 1);
        _text2 = "<t align='left' size='0.5' color='#a41f00'>"+_finaltxt+"</t>";
        systemchat format["%1",_finaltxt];
        [_text2,[safezoneX + 0.01 * safezoneW,2.0],[safezoneY + 0.01 * safezoneH,0.3],30,0.5] spawn BIS_fnc_dynamicText;
    };

also I added an additional feature for players to show as anonymous. So instead of "Player1 killed by player2 with M4 from [#m]" players could turn a feature on to make it "Player1 killed by Anonymous with M4 from [#m]".

The code for that can be tied into a scroll menu easily I just have it tied into my player menu dialog so I can only supply the code for it:
Code for anonymous status toggle:
Code:
_anonstat = profileNamespace getVariable 'Anon';
if (isnil '_anonstat') then {
    player setVariable ['Anon',false,true];
};
if (player getvariable 'Anon') then {
    profileNamespace setVariable ['Anon',false];
    player setVariable ['Anon',false,true];
    systemchat 'Your name will show up in kill messages now...';
} else {
    profileNamespace setVariable ['Anon',true];
    player setVariable ['Anon',true,true];
    systemchat 'You will now be anonymous in kill messages.';
};
saveProfileNamespace;

init.sqf in the !isDedicated portion add this for anonym:
Code:
_anonstat = profileNamespace getVariable "Anon";
    if (isnil "_anonstat") then {
        player setVariable ["Anon",false,true];
        profileNamespace setVariable ["Anon",false];
        saveProfileNamespace;
    } else {
        if (_anonstat) then {
            player setVariable ["Anon",true,true];
        } else {
            player setVariable ["Anon",false,true];
        };
    };

NOTE:

only issues I've seen with the way I've done it is that sometimes if you get shot by someone and run off and die it'll count the last person to shoot you as killing you since they were the last player to hit you. Never got around to adding a fix for it.
 

HospitalChair

Well-Known Member
Doesn't appear to be working. Just logged into the server and after a couple of kills (kill messages seem to be notorious for not working 100% of the time) it's still just showing the standard "Player was killed" message.

Just for clarification when you say client side you dont actually mean that they have to tweak their own file for that, it can just be called in the mpmission folder, correct?
 

Inkko

OpenDayZ Rockstar!
Doesn't appear to be working. Just logged into the server and after a couple of kills (kill messages seem to be notorious for not working 100% of the time) it's still just showing the standard "Player was killed" message.

Just for clarification when you say client side you dont actually mean that they have to tweak their own file for that, it can just be called in the mpmission folder, correct?

Here is a dropbox folder I made to show the structure. You can kinda see how I added it in.

https://www.dropbox.com/sh/kkhvpk288rh4e4d/AAB1gY8JwYCYdtI0vnhjVBV1a?dl=0
 
Last edited:

HospitalChair

Well-Known Member
I was. Not sure why the edits i made originally didnt work but the files you uploaded did. The only thing and it's relatively minor is that it shows the kill message in the top left in red and again in the chat feed...It's a little redundant but a minor gripe for a script i've been trying to get to work for a while. Much appreciated! Oh and i dont suppose you know how to add a picture of the gun in message. Not a big deal just some flare.

Thanks again, you've been a great help! Glad to have another go to guy on these forums.
 

Inkko

OpenDayZ Rockstar!
I was. Not sure why the edits i made originally didnt work but the files you uploaded did. The only thing and it's relatively minor is that it shows the kill message in the top left in red and again in the chat feed...It's a little redundant but a minor gripe for a script i've been trying to get to work for a while. Much appreciated! Oh and i dont suppose you know how to add a picture of the gun in message. Not a big deal just some flare.

Thanks again, you've been a great help! Glad to have another go to guy on these forums.

I remember why I did the repetitive messages with systemchat and the top left message as well.... It was for if 2 players died at once since the top left message will get overwritten with each new kill. So it was more in the chat area to show all since the top left sometimes will skip some with multiple deaths. As for the picture part I think I had that working at one point but changed it for some reason.
 

HospitalChair

Well-Known Member
Good call on the duplicated message, i do remember that being an issue with the last script i had. Thanks again for your help. Do you mind if i PM you if i hit any other roadblocks in the future?
 

Inkko

OpenDayZ Rockstar!
Good call on the duplicated message, i do remember that being an issue with the last script i had. Thanks again for your help. Do you mind if i PM you if i hit any other roadblocks in the future?

fine with me, may not be able to do everything but I can help with some things.
 

MikeCandys

Well-Known Member
I tried to apply it on 1.9.0 and i get this error now:

2022/09/12, 16:30:14 "DeathMessage: AndreasH was killed by micha with MG36_DZN from 2m"
2022/09/12, 16:30:14 WARNING: Function 'name' - 39452040# 201593: camowinter_dzn.p3d REMOTE has no unit
2022/09/12, 16:30:14 - network id 6:149
2022/09/12, 16:30:14 - person Alyosha Produnov
2022/09/12, 16:30:14 - dead
2022/09/12, 16:30:14 "Error: No unit killed by micha with MG36 from [2m]"

2022/09/12, 16:31:50 "DeathMessage: micha was killed by AndreasH with SVD_PSO1_DZ from 3m"
2022/09/12, 16:31:50 WARNING: Function 'name' - 35f10080# 200568: ghillie_overall.p3d REMOTE has no unit
2022/09/12, 16:31:50 - network id 3:5
2022/09/12, 16:31:50 - person Stanislav Novak
2022/09/12, 16:31:50 - dead
2022/09/12, 16:31:50 "Error: No unit killed by AndreasH with SVD PSO-1 from [3m]"

Anyone can help fix this "Error: No unit"
 

Inkko

OpenDayZ Rockstar!
I tried to apply it on 1.9.0 and i get this error now:

2022/09/12, 16:30:14 "DeathMessage: AndreasH was killed by micha with MG36_DZN from 2m"
2022/09/12, 16:30:14 WARNING: Function 'name' - 39452040# 201593: camowinter_dzn.p3d REMOTE has no unit
2022/09/12, 16:30:14 - network id 6:149
2022/09/12, 16:30:14 - person Alyosha Produnov
2022/09/12, 16:30:14 - dead
2022/09/12, 16:30:14 "Error: No unit killed by micha with MG36 from [2m]"

2022/09/12, 16:31:50 "DeathMessage: micha was killed by AndreasH with SVD_PSO1_DZ from 3m"
2022/09/12, 16:31:50 WARNING: Function 'name' - 35f10080# 200568: ghillie_overall.p3d REMOTE has no unit
2022/09/12, 16:31:50 - network id 3:5
2022/09/12, 16:31:50 - person Stanislav Novak
2022/09/12, 16:31:50 - dead
2022/09/12, 16:31:50 "Error: No unit killed by AndreasH with SVD PSO-1 from [3m]"

Anyone can help fix this "Error: No unit"
It has been years since I've done any coding but do you have any additional details on the deaths? Odd that the name function wouldn't pull a name unless the player for some reason isn't getting sent through the script.
 

MikeCandys

Well-Known Member
I just installed 1.9.0 mod and added namalsk

ive seen the only difference between the 1.8.7 code and the 1.9.0 code is in the server_playerDied.sqf:

they added some new variables called:

_characterID = _this select 0;
_minutes = _this select 1;
_newObject = _this select 2;
_playerID = _this select 3;
_playerName = toString (_this select 4); //Sent as array to avoid publicVariable value restrictions
_infected = _this select 5;
_sourceName = toString (_this select 6);
_sourceWeapon = _this select 7;
_distance = _this select 8;
_method = _this select 9;

i thought maybe it has to do something with it?


And other then that when i see someone and i shoot him it says : Error: No unit killed by AndreasH with SVD PSO-1 from [3m] in sidechat and in red on the left top how it should be.

Also i noticed for some weird reason i kill a player with (2500 humanity) and it counts as a bandit kill.

Not sure yet but i think it has something to do with eighter ConfirmedHumanKills/ConfirmedBanditKills in server_playerSetup.sqf

also could be the skin they are wearing, but not sure:

Random Thesis(not proven jet)
for example if he has Skin_Survivor2_DZ on it is a survivor kill, if he has camo clothing, ghillie or anything else it counts sometimes as bandit kill. idk why.
 

Inkko

OpenDayZ Rockstar!
I just installed 1.9.0 mod and added namalsk

ive seen the only difference between the 1.8.7 code and the 1.9.0 code is in the server_playerDied.sqf:

they added some new variables called:

_characterID = _this select 0;
_minutes = _this select 1;
_newObject = _this select 2;
_playerID = _this select 3;
_playerName = toString (_this select 4); //Sent as array to avoid publicVariable value restrictions
_infected = _this select 5;
_sourceName = toString (_this select 6);
_sourceWeapon = _this select 7;
_distance = _this select 8;
_method = _this select 9;

i thought maybe it has to do something with it?


And other then that when i see someone and i shoot him it says : Error: No unit killed by AndreasH with SVD PSO-1 from [3m] in sidechat and in red on the left top how it should be.

Also i noticed for some weird reason i kill a player with (2500 humanity) and it counts as a bandit kill.

Not sure yet but i think it has something to do with eighter ConfirmedHumanKills/ConfirmedBanditKills in server_playerSetup.sqf

also could be the skin they are wearing, but not sure:

Random Thesis(not proven jet)
for example if he has Skin_Survivor2_DZ on it is a survivor kill, if he has camo clothing, ghillie or anything else it counts sometimes as bandit kill. idk why.

From a quick look you could try this to see if it resolves the issue. in the server_playerDied.sqf change the start of the kill messages to this
Code:
[_newObject,_playerName] spawn {
and also change _unitname = name _unit; to this
Code:
 _unitname = _this select 1;
This should change it to use the name that's being passed through the PVEH.

Cause it does also look like they've put a death messages into 1.9.0

I do remember something about skins being weird with humanity tho. I think some skins were hard coded to be "bandit" skins.
 

MikeCandys

Well-Known Member
From a quick look you could try this to see if it resolves the issue. in the server_playerDied.sqf change the start of the kill messages to this
Code:
[_newObject,_playerName] spawn {
and also change _unitname = name _unit; to this
Code:
 _unitname = _this select 1;
This should change it to use the name that's being passed through the PVEH.

Cause it does also look like they've put a death messages into 1.9.0

I do remember something about skins being weird with humanity tho. I think some skins were hard coded to be "bandit" skins.
Cause it does also look like they've put a death messages into 1.9.0

Yea ive thought so too but i couldnt find the variable to like kind of activate it. like dayz_killmessage = true; in config.cfg or sth :D

ill try it and let u know what's going on.
 

Inkko

OpenDayZ Rockstar!
Cause it does also look like they've put a death messages into 1.9.0

Yea ive thought so too but i couldnt find the variable to like kind of activate it. like dayz_killmessage = true; in config.cfg or sth :D

ill try it and let u know what's going on.
If it still doesn't work I may need to see your files.
 

MikeCandys

Well-Known Member
So now i have the problem that some players are floating in the debug world.

it says for me:

2022/09/23, 8:52:59 "INFO - Player: PID#4(JAMROCK)(UID:76561198118934038/CID:63) Status: LOGGING IN"
2022/09/23, 8:52:59 "INFO - Player: PID#4(JAMROCK)(UID:76561198118934038/CID:63) Status: LOGIN PUBLISHING, Location West point [021069]"
2022/09/23, 8:53:09 "INFO - Player: JAMROCK(UID:76561198118934038/CID:63) Status: CLIENT LOADED & PLAYING"

and when i disconnect:

2022/09/23, 8:59:01 "INFO: OnPlayerDisconnect exiting. Player is not in playableUnits. ["76561198118934038","JAMROCK"]"

and also after restart when u join my friend was in debug (floating in the water)

2022/09/23, 8:07:21 Server error: Player without identity jakob (id 1108041269)
2022/09/23, 8:07:21 Server error: Player without identity jakob (id 1108041269)
2022/09/23, 8:07:21 Server error: Player without identity jakob (id 1108041269)
2022/09/23, 8:07:21 Server error: Player without identity jakob (id 1108041269)
2022/09/23, 8:07:21 Server error: Player without identity jakob (id 1108041269)
2022/09/23, 8:07:21 Server error: Player without identity jakob (id 1108041269)
2022/09/23, 8:07:21 Server error: Player without identity jakob (id 1108041269)
2022/09/23, 8:07:21 Server error: Player without identity jakob (id 1108041269)
2022/09/23, 8:07:21 Server error: Player without identity jakob (id 1108041269)
2022/09/23, 8:07:21 Server error: Player without identity jakob (id 1108041269)
2022/09/23, 8:07:21 Server error: Player without identity jakob (id 1108041269)
2022/09/23, 8:07:21 Server error: Player without identity jakob (id 1108041269)
2022/09/23, 8:07:21 Server error: Player without identity jakob (id 1108041269)
2022/09/23, 8:07:21 Server error: Player without identity jakob (id 1108041269)


I am honestly not sure if it is your kill messages fault. Could be also that i use dayz 1.9.0 mp mission and server pbo for a combination with 0.75 namalsk.

maybe i need to set the spawn area and marker distance korrekt like old namalsk mp missions. but i dont know where.

so you could help me out there i can sent you the files with email or wetransfer or whatever method you prefer :)
 
Top