PlayerRace
string PlayerRace(int player);
Race of the player
Parameters
- int player
Player to check
Return value
string -
- Empty String: If the player is not in the game
- "Zerg", "Prot", "Terr": The player race
Examples
- Example #1
// A map with a Zerg, a Protoss and a Terran string race; race = PlayerRace(1); // "Zerg" race = PlayerRace(2); // "Prot" : Protoss race = PlayerRace(3); // "Terr" : Terran race = PlayerRace(4); // ""
- Example #2: Debugging
function DebugPlayer(int player, string message) { string formatted = "Player " + IntToString(player) + " (" + PlayerRace(player) + ") - " + message; TriggerDebugOutput(1, TextToString(formatted), false); } // DebugPlayer(1, "is a noob"); // Will print something like: "Player 1 (Zerg) - is a noob"
- 1 comment
- 1 comment
- Reply
- #1
vjeux Mar 12, 2010 at 10:52 UTC - 0 likesGet a integer instead of a string