gpAllPlayers() - Get All Human Players

This page provides a detailed example of how this method is used in the TWC codebase.

Method Signature

public static Player[] gpAllPlayers(this IGamePlay GP)

Example Usage in TWC Code

var players = GamePlay.gpAllPlayers();
foreach (var player in players) {
Console.WriteLine($"Player: {player.Name}");
}

Explanation

This method retrieves all human players currently in the game.

Flug's Insight

Works well, but may include spectators. Filtering active players is recommended.