Onplayerdeath reason code

Started by Finch Real, Jul 21, 2016, 09:43 AM

Previous topic - Next topic

Finch Real

Hello Well I am using this on playerdeath
Message( " you killed " + reason + " " );
But it always return reason in number is there any way i get reason in some nàme like you killed reàson drowned?
My Snipet Showroom

http://pastebin.com/5KKuU5cg

DizzasTeR

@Stormeus, if you take out a few moments, can you please add the Death and Kill constants here at wiki constants because right now its a pain.

In other words I had found this function from I don't know where so you can use it:
function GetDeathReason( reason )
{
switch( reason )
{
case 70:
return "Suicide";
break;

case 39:
return "Car crash";
break;

case 31:
return "Burned";
break;

case 14:
return "Choke";
break;

case 43:
return "Drowned";
break;

case 41:
return "Explosion";
break;

case 44:
return "Fall";
break;
}
}

Some of them may not be present in there but I'm not sure.

Finch Real

My Snipet Showroom

http://pastebin.com/5KKuU5cg

KAKAN

@Doom_Kill3R Use GetWeaponName( reason )
It should work.
oh no