Skip to content

Commit

Permalink
add GetPlayerDead
Browse files Browse the repository at this point in the history
  • Loading branch information
misternebula committed Jan 30, 2024
1 parent 1c62ff2 commit 0ab5f5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions QSB/API/IQSBAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ public interface IQSBAPI
/// <param name="playerID">The ID of the player.</param>
bool GetPlayerReady(uint playerID);

/// <summary>
/// Returns true if the given player is dead.
/// </summary>
/// <param name="playerID">The ID of the player.</param>
bool GetPlayerDead(uint playerID);

/// <summary>
/// Returns the list of IDs of all connected players.
///
Expand Down
7 changes: 7 additions & 0 deletions QSB/API/QSBAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint> OnPlayerJoin() => QSBAPIEvents.OnPlayerJoinEvent;
Expand Down

0 comments on commit 0ab5f5d

Please sign in to comment.