diff --git a/QSB/API/IQSBAPI.cs b/QSB/API/IQSBAPI.cs index c1045c6bb..a0befa526 100644 --- a/QSB/API/IQSBAPI.cs +++ b/QSB/API/IQSBAPI.cs @@ -55,6 +55,12 @@ public interface IQSBAPI /// The ID of the player. bool GetPlayerReady(uint playerID); + /// + /// Returns true if the given player is dead. + /// + /// The ID of the player. + bool GetPlayerDead(uint playerID); + /// /// Returns the list of IDs of all connected players. /// diff --git a/QSB/API/QSBAPI.cs b/QSB/API/QSBAPI.cs index 778a670ca..911c1166b 100644 --- a/QSB/API/QSBAPI.cs +++ b/QSB/API/QSBAPI.cs @@ -33,6 +33,13 @@ public bool GetPlayerReady(uint playerId) var player = QSBPlayerManager.GetPlayer(playerId); return player.IsReady && player.Body != null; } + + public bool GetPlayerDead(uint playerId) + { + var player = QSBPlayerManager.GetPlayer(playerId); + return player.IsDead; + } + public uint[] GetPlayerIDs() => QSBPlayerManager.PlayerList.Select(x => x.PlayerId).ToArray(); public UnityEvent OnPlayerJoin() => QSBAPIEvents.OnPlayerJoinEvent;