Advanced Kill-Messages

SchwEde

OpenDayZ Rockstar!
Hey Guys,

hope someone can help me with this one. I try to get the Kill-Messages working with the info on who killed who.

I tried it with this Tutorial:
http://dayz.st/w/Kill_Messages

Sadly no no luck.

When I'm using this server_playerDied.sqf with the changes from the tutorial i get them only once after a restart.
Code:
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"

private ["_characterID","_minutes","_newObject","_playerID","_key", "_killer", "_weapon", "_distance","_loc_message","_killerName","_killerPlayerID"];
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]

_characterID =     _this select 0;
_minutes =    _this select 1;
_newObject =     _this select 2;
_playerID =     _this select 3;
_playerName =     name _newObject;

_newObject setVariable["processedDeath",diag_tickTime];
_newObject setVariable ["bodyName", _playerName, true];

_killer = _newObject getVariable["AttackedBy", "nil"];
_killerName = _newObject 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 = _newObject getVariable["AttackedByWeapon", "nil"];
    _distance = _newObject getVariable["AttackedFromDistance", "nil"];

    if (_playerName == _killerName) then
    {
        _loc_message = format["PKILL: %1 killed themselves near %2", _playerName, (getPosATL _newObject) call fa_coor2str];
    }
    else
    {
        _killerPlayerID = getPlayerUID _killer;
        _loc_message = format["PKILL: %1 (%5) was killed near %7 by %2 (%6) with weapon %3 from %4m", _playerName, _killerName, _weapon, _distance, _playerID, _killerPlayerID, (getPosATL _newObject) call fa_coor2str];
    };

    diag_log _loc_message;

    // Cleanup
    _newObject setVariable["AttackedBy", "nil", true];
    _newObject setVariable["AttackedByName", "nil", true];
    _newObject setVariable["AttackedByWeapon", "nil", true];
    _newObject setVariable["AttackedFromDistance", "nil", true];
} else {
    _loc_message = format["PKILL: %1 was killed near %2", _playerName, (getPosATL _newObject) call fa_coor2str];
    diag_log _loc_message;
};

if (typeName _minutes == "STRING") then
{
    _minutes = parseNumber _minutes;
};

if (_characterID != "0") then
{
    _key = format["CHILD:202:%1:%2:",_characterID,_minutes];
    //diag_log ("HIVE: WRITE: "+ str(_key));
    _key call server_hiveWrite;
}
else
{
    deleteVehicle _newObject;
};

#ifdef PLAYER_DEBUG
format ["Player UID#%3 CID#%4 %1 as %5 died at %2",
    _newObject call fa_plr2str, (getPosATL _newObject) call fa_coor2str,
    getPlayerUID _newObject,_characterID,
    typeOf _newObject
];
#endif

//dead_bodyCleanup set [count dead_bodyCleanup,_newObject];

found here: http://forums.dayzgame.com/index.php?/topic/148722-logging-player-death-messages/


What i know so far is that for some reason
Code:
if (_killerName != "nil") then
is allways "nil" after the first time.

I just dont know how or what what to do to get this fix.

Version: DayZ 1.8.0.3

Thanks for any help
 
Hey guys,

what i know so far is that they work fantastic if you just follow this tutorial and replace everything. The Problem that i have is caused by ebays Select Spawn and Start Gear-script that i use. To be specific its this part:
Code:
PVCDZ_plr_Login2 = [_worldspace,_state,_randomSpot];

I could not find a solution to work both correctly so far, so i just keep the messages out of my server for now.
Maybe someone have an idea how to get them work together =)
 
Back
Top