[C#] OnPlayerKilled killerinfo

Hi there,

According to the OnPlayerKilled Documentation we can access a table with killerInfo, could someone tell me how i would retrieve that info?

This is what i currently have:

public ServerMain()
{
    EventHandlers.Add("baseevents:onPlayerDied", new Action<Player, string, Vector3>(OnPlayerDied));
    EventHandlers.Add("baseevents:onPlayerKilled", new Action<Player, int>(OnPlayerKilled));
}

private void OnPlayerDied([FromSource] Player player, string reason, Vector3 pos)
{
}

private void OnPlayerKilled([FromSource] Player player, int killerId)
{
    Player killer = Players[killerId];
    Utils.Message($"{player.Name} was killed by {killer.Name}");
}

the idea is, obviously, to include more information about the killer.
is the killerInfo table, which is available in LUA, also available to us in C#? and if so what kind of object is passed in the event?

Anyone who can point me in the right direction?
Thanks in advance…

Yup, i’m a fool…

the onPlayerKilled event spits out an ExpandoObject, instead of a Table, which contains all the info.

1 Like