Kill messages/Death messages

add my code at the very end of switchmodel.sqf. This way even if you change cloth the eventhandler is always added back

Ok, so I added

Code:
player addEventHandler ["killed", {
 
[nil, nil, rHINT, "Dude, I died!"] call RE;
 
}];

to the end of my player_switchModel.sqf and the kill messages work, until someone changes clothes. So I then tried

Code:
//BackUp Player Object
_oldUnit = player;
 
player addEventHandler ["killed", {
 
[nil, nil, rHINT, "Dude, I died!"] call RE;
 
}];
 
/***********************************/
//DONT USE player AFTER THIS POINT
/***********************************/
 
//Create New Character
But this had the same effect. Does it matter that I am using some of the unbanned skins on my server?

Edit; as this is set to use rHINT will my debug monitor be in the way of the message?
 
Ok, so I added

Code:
player addEventHandler ["killed", {
 
[nil, nil, rHINT, "Dude, I died!"] call RE;
 
}];

to the end of my player_switchModel.sqf and the kill messages work, until someone changes clothes. So I then tried

Code:
//BackUp Player Object
_oldUnit = player;
 
player addEventHandler ["killed", {
 
[nil, nil, rHINT, "Dude, I died!"] call RE;
 
}];
 
/***********************************/
//DONT USE player AFTER THIS POINT
/***********************************/
 
//Create New Character
But this had the same effect. Does it matter that I am using some of the unbanned skins on my server?

Edit; as this is set to use rHINT will my debug monitor be in the way of the message?



it should only effect the debug always on version, the toggle should be fine with it.
 
it should only effect the debug always on version, the toggle should be fine with it.

Ok, maybe I just didn't notice the message when I briefly tested it out. If I want this message to still appear after a player changes clothes, but have it displayed as the regular; Global (playername) X was killed by Y with weapon Z from ##.##m, how should I change it?
 
Use the code I've posted earlier. Works fine.

Tapnięte za pomocą HTC Desire S
 
Thanks cyrq. I'll try it now.

Re-reading my last post I guess I wasn't clear enough. I have the messages working, but didn't want some in global and some as a hint ;)
 
Thanks cyrq. I'll try it now.

Re-reading my last post I guess I wasn't clear enough. I have the messages working, but didn't want some in global and some as a hint ;)


Code:
player addEventHandler ["killed", {
[nil, nil, rspawn, [_victim, _message], { (_this select 0) globalChat (_this select 1) }] call RE;
}]; //end hangender killmsg

this will post the death msg in global. and thru the person who died. so if you wanted it to not show killer you could use this otherwize killer says message.

if you dont want hints then use this for both parts i guess.
 
Ok, cheers. I've tried both ways; cyrq's and ALKINDA's but am getting kicked for script retricitons when I join the server. With cyrq's method everyone is kicked for script restriciton #53, and with ALKINDA's method script restriction #126. SO, I guess tht means they are both working at least :)

This is my error form the logs;
#126 ";
player addEventHandler ["test kill message", {
[nil, nil, rspawn, [_killer, _message], { (_this select 0) globalChat (_this s"

Had a look at lines 120-130 but can't see what I should be doing with it.
 
Find
Code:
 5 addMPEventHandler
Add
Code:
!"player addMPEventHandler ["MPHit", {_this spawn server_playerHit;}]"

Tapnięte za pomocą HTC Desire S
 
Find
Code:
 5 addMPEventHandler
Add
Code:
!"player addMPEventHandler ["MPHit", {_this spawn server_playerHit;}]"

Tapnięte za pomocą HTC Desire S

Ok, that seems to do the trick. I am however now getting kicked for EventHandler #8

#8 "Hit" 2:0 Survivor1_DZ - "_this spawn server_playerHit;"

Did I mention how much I appreciate your help? dziękuję!
 
I've tried it on my test server without BE running and there are still no kill messages once a player changes clothes. Even if that player dies. Once they have changed clothing without leaving the server it does not work. Surely I'm going wrong here?
 
Ok. So your running Taviana @ DayZ.ST?
Dunno what kind of build those guys are using.
You probably using fnc_plyrHit.sqf instead of server_playerHit.sqf
Soo...
Right at the bottom add of player_switchModel.sqf add:
Code:
// Add MPEventHandler
    player addMPEventHandler ["MPHit", {_this spawn fnc_plyrHit;}];
    diag_log ("PLAYER: SETUP: Hit Event added after model change");
The scripts.txt exeption should look like:
Code:
!"player addMPEventHandler ["MPHit", {_this spawn fnc_plyrHit;}]"
 
Yes it's Tavi @ DayZ.st. I don't have time to check right now, but will give this a go later. Thanks again!

edit: It works perfectly now. Thanks again. I really appreciate your time and patience with me :)
 
I have this portion working correctly
Code:
    diag_log _loc_message;
    [nil, nil, rspawn, [_victim, _message], { (_this select 0) globalChat (_this select 1) }] call RE;
    //[nil, nil, rHINT, _message] call RE;

but wondering if I could do this for admins to be displayed who killed who.
Code:
    if ((getPlayerUID player) in ["ADMINUID"]) then
    {
        [nil, nil, rspawn, [_victim, _message], { (_this select 0) globalChat (_this select 1) }] call RE;
    }
    else
    {
        [nil, nil, rspawn, [_victim, _loc_message], { (_this select 0) globalChat (_this select 1) }] call RE;
    };

I tried it, but it did not work at all.
 
I have this portion working correctly
Code:
    diag_log _loc_message;
    [nil, nil, rspawn, [_victim, _message], { (_this select 0) globalChat (_this select 1) }] call RE;
    //[nil, nil, rHINT, _message] call RE;

but wondering if I could do this for admins to be displayed who killed who.
Code:
    if ((getPlayerUID player) in ["ADMINUID"]) then
    {
        [nil, nil, rspawn, [_victim, _message], { (_this select 0) globalChat (_this select 1) }] call RE;
    }
    else
    {
        [nil, nil, rspawn, [_victim, _loc_message], { (_this select 0) globalChat (_this select 1) }] call RE;
    };

I tried it, but it did not work at all.


hmmm interesting idea... looks correct, only thing i would change is ADMINUID line

Code:
if ((getPlayerUID vehicle player) in ["ADMINUID#####"]) then {

took that out of debug monitor, think you are missing the vehicle in the if
 
Code:
V1.2.01
Change log for V1.2.01
[BugFix] Changed (getPlayerUID vehicle player) to (getPlayerUID player). Thanks to rotceh_dnih
 
Ok. So your running Taviana @ DayZ.ST?
Dunno what kind of build those guys are using.
You probably using fnc_plyrHit.sqf instead of server_playerHit.sqf
Soo...
Right at the bottom add of player_switchModel.sqf add:
Code:
// Add MPEventHandler
    player addMPEventHandler ["MPHit", {_this spawn fnc_plyrHit;}];
    diag_log ("PLAYER: SETUP: Hit Event added after model change");
The scripts.txt exeption should look like:
Code:
!"player addMPEventHandler ["MPHit", {_this spawn fnc_plyrHit;}]"


Server: Dayz.st
Map: Chernarus

Hi All,

I manage to display the kill msg as hint, but still have some problem after players change cloth the kill msg stop working.

I do not have player_switchModel.sqf in my mission pbo, so i copy from dayz_code and added the below mention code at the end of switchmodel. But no luck of getting it work.

Try adding it to fnc_plyrHit.sqf, also no luck.. would any please shed some light on me with thanks!

code added to switchmodel:

Code:
// Add MPEventHandler
    player addMPEventHandler ["MPHit", {_this spawn fnc_plyrHit;}];
    diag_log ("PLAYER: SETUP: Hit Event added after model change");
 
hey, just was thinking of tinkering this a bit but dont know where to start.

I want to include a trading area for people on my server. i am going to put a map marker in that area so people know where it is. i then want to make it tell everyone who killed them, when killed in this area.

I currently have it so it only says the dead persons name gun and distance everywhere on the map.
so i would have to include some kind of if script inside this script.

Has anyone already done this? thanks for your help.
 
will this not work on a public server..... Because i am having no luck whatsoever on getting it to work.

Okay nevermind i got it to work, but how can i remove the chat tag? i want it to come up like a normal player kill does "Player" was killed" but i have it set "Player" was killed by a "Weapon"

But i get BLUFOR (Player) "Victim" was killed by a "Weapon"


There should be a way to make it come through like the MOTD. I just don't know how....
 
well maybe im to stupid but Alkinda, where should i add your code? i dont get it lol... (i use Overwatch) and i dont get the death message work (with the dayz.st one)
 
Back
Top