GetPlayerIdentifiers

Returns a table containing all of the player’s identifiers.

Syntax

GetPlayerIdentifiers(Player player)

Required arguments

  • player: The ID of the player to get the identifiers from.

License Types

Type IDProviderTypeData Type
steamSteamSteam Idhex
discordDiscordUser Idint
xblXbox Liveint
liveMicrosoft PUIDPassport Unique Identifierint
licenseRockstar Online ServicesHashhex
license2Rockstar Online ServicesHashhex
fivemCfx.reUser Idint
ipIP AddressIPv4string
  • license2 - This identifier is the ROS license for people who use steam, this identifier can be the same value as license

Examples

Check for commonly used identifiers with this method; works well when triggered by the playerConnecting event.

local identifiers = {}
local playerIdents = GetPlayerIdentifiers(source)

for i = 1, #playerIdents do
  local ident = playerIdentifiers[i]
  local colonPosition = string.find(ident, ":") - 1
  local identifierType = string.sub(ident, 1, colonPosition)
  identifiers[identifierType] = ident
end

-- if you want the fivem identifier you would do this:
print(identifiers["fivem"]) -- returns fivem:123456789