Hello,I want to write a plugin broadcast message when heli was taken down,but it doesnt work.
void OnEntityDeath(BaseCombatEntity entity, HitInfo info)
{
var killerPlayer = info?.Initiator?.ToPlayer(); //it seems doesn't work
if(entity is BaseHelicopter && killerPlayer.IsValid())
rust.BroadcastChat("Patrol Helicopter has been taken down by " + killerPlayer.displayName);
}
but this works
void OnEntityDeath(BaseCombatEntity entity, HitInfo info)
{
if(entity is BaseHelicopter )
rust.BroadcastChat("Patrol Helicopter has been taken down ");
}
Can't record who killde the heli
Discussion in 'Rust Development' started by HappyHordor, Jul 5, 2017.