Returns a table containing all of the player’s identifiers.
GetPlayerIdentifiers(Player player)
Type ID | Provider | Type | Data Type |
---|---|---|---|
steam | Steam | Steam Id | hex |
discord | Discord | User Id | int |
xbl | Xbox Live | int | |
live | Microsoft PUID | Passport Unique Identifier | int |
license | Rockstar Online Services | Hash | hex |
license2 | Rockstar Online Services | Hash | hex |
fivem | Cfx.re | User Id | int |
ip | IP Address | IPv4 | string |
license2
- This identifier is the ROS license for people who use steam, this identifier can be the same value as license
Check for commonly used identifiers with this method; works well when triggered by the playerConnecting
event.
If you only need to get a single identifier you can use GET_PLAYER_IDENTIFIER_BY_TYPE, if you need to get multiple you should use the below example.
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