Steam.GetPlayerSteamID (Civ5 API)

From Civilization Modding Wiki
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of Steam.

This is a static method, invoke it with a dot.


Returns the Steam ID information for a specific Player


Usage

table(unknown => unknown) Steam.GetPlayerSteamID(PlayerID player)


Returned Value

Returns a table with the following fields:
PlayerName
Their current steam display name
IsOnline
Are they online?
ID
a 64-bit integer represented as a string pertaining to their ID.

Parameters

player: The player's Game ID, typically between 0 and #Players;


Examples

-- Print all player's SteamIDs
for i,v in ipairs(Players) do
if(v:IsHuman() then
local steamID = Steam.GetPlayerSteamID(i);
print(string.format("[%i] %s - %s", i, steamID.PlayerName, steamID.ID);
else
print(string.format("[%i] Computer", i);
end
end


The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.