Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Finch Real on Jul 21, 2016, 09:43 AM

Title: Onplayerdeath reason code
Post by: Finch Real on Jul 21, 2016, 09:43 AM
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?
Title: Re: Onplayerdeath reason code
Post by: DizzasTeR on Jul 21, 2016, 09:49 AM
@Stormeus, if you take out a few moments, can you please add the Death and Kill constants here at wiki constants (http://wiki.vc-mp.org/wiki/Scripting/Squirrel/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.
Title: Re: Onplayerdeath reason code
Post by: Finch Real on Jul 21, 2016, 10:11 AM
Thanks :)
Title: Re: Onplayerdeath reason code
Post by: KAKAN on Jul 21, 2016, 02:02 PM
@Doom_Kill3R Use GetWeaponName( reason )
It should work.