identifierslicenseplayers9 min read · updated 9/11/2026

Player identifiers in FiveM

Every connected player comes with a set of identifiers — strings like license:1a2b… and discord:1234…. They are how you save characters, give staff permissions and ban cheaters. Knowing which ones are always present, and which only sometimes, prevents a whole class of bugs.

Short answer: FiveM provides license (Rockstar licence, always present), license2 (the ROS licence for Steam users; can equal license), discord (if Discord is running and linked), fivem (if logged in to Cfx.re), steam (only with a steam_webApiKey set and Steam running) and ip. Read them with GetPlayerIdentifiers(src) or GetPlayerIdentifierByType(src, 'license'). Use license as the stable key; add tokens (GetPlayerToken) for bans.

FiveM Player Identifiers: license, license2, discord, fivem, steam and IP

#The identifier types

TypeSourceAlways present?Example
licenseRockstar (ROS) licence hashYeslicense:1a2b3c…
license2ROS licence for Steam usersUsually; may equal licenselicense2:…
discordDiscord user IDOnly if Discord is running and linkeddiscord:123456789012345678
fivemCfx.re account IDOnly if logged in to Cfx.refivem:1234567
steamSteam ID (hex)Only with steam_webApiKey and Steam runningsteam:11000010…
ipIP addressYesip:203.0.113.7

From Cfx.re’s GetPlayerIdentifiers documentation. You may also see Microsoft (`xbl`, `live`) identifiers.

#Reading identifiers

server.lua
local license = GetPlayerIdentifierByType(src, 'license')   -- 'license:…' or nil
local discord = GetPlayerIdentifierByType(src, 'discord')

-- all of them as a table keyed by type
local ids = {}
for _, id in ipairs(GetPlayerIdentifiers(src)) do
    local kind = id:match('^(%w+):')
    ids[kind] = id
end

Identifiers are available from playerConnecting onward (with the temporary source), so whitelists and bans can check them before the player loads.

#Which identifier to store

Use license as the account key — every player has one. Frameworks do the same (ESX’s identifier, QBCore’s license column). Store discord as an extra field for staff tools and whitelists, not as the primary key, because it disappears when Discord is closed.

#Identifiers and bans

A new Rockstar account gives a new licence, so bans that check only license are easy to evade. Store every identifier plus the player’s tokens (GetNumPlayerTokens / GetPlayerToken) and match any of them — see ban systems.

#Privacy

IP addresses and account IDs are personal data in many jurisdictions. Store only what you use, restrict who can see it (not every moderator needs IPs), and delete old logs.

Questions

What is the license identifier in FiveM?
A hash of the player’s Rockstar licence. Every player has one, which makes it the best primary key.
What is license2?
The ROS licence for players using Steam; it can be the same as license.
Why is the discord identifier missing?
Discord must be running (desktop app) and linked when FiveM starts.
How do I get the Steam identifier?
Set steam_webApiKey in server.cfg; players need Steam running.
How do I get one identifier in Lua?
GetPlayerIdentifierByType(source, 'license').

Ready to pick a map?

Twelve themes on three base map styles, $8 each, instant download.