Bump version

Add kill message
This commit is contained in:
oldnapalm
2023-10-06 16:36:49 -03:00
parent 14151d7b2c
commit d0eb0b7818
4 changed files with 17 additions and 6 deletions

View File

@ -171,6 +171,7 @@ namespace RageCoop.Client
Game.Player.WantedLevel = 0;
Main.Logger.Debug("Player died.");
Scripting.API.Events.InvokePlayerDied();
KillMessage();
}
GTA.UI.Screen.StopEffects();
}
@ -182,6 +183,7 @@ namespace RageCoop.Client
else if (P.IsDead && !_lastDead)
{
Scripting.API.Events.InvokePlayerDied();
KillMessage();
}
_lastDead = P.IsDead;
@ -393,5 +395,14 @@ namespace RageCoop.Client
});
}
public static void KillMessage()
{
if (P.Killer != null)
{
var killer = EntityPool.GetPedByHandle(P.Killer.Handle);
if (killer != null && killer.ID == killer.Owner.ID)
Scripting.API.SendChatMessage($"Killed by {killer.Owner.Username} ({P.CauseOfDeath})");
}
}
}
}