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.

#The identifier types
| Type | Source | Always present? | Example |
|---|---|---|---|
license | Rockstar (ROS) licence hash | Yes | license:1a2b3c… |
license2 | ROS licence for Steam users | Usually; may equal license | license2:… |
discord | Discord user ID | Only if Discord is running and linked | discord:123456789012345678 |
fivem | Cfx.re account ID | Only if logged in to Cfx.re | fivem:1234567 |
steam | Steam ID (hex) | Only with steam_webApiKey and Steam running | steam:11000010… |
ip | IP address | Yes | ip:203.0.113.7 |
From Cfx.re’s GetPlayerIdentifiers documentation. You may also see Microsoft (`xbl`, `live`) identifiers.
#Reading identifiers
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
endIdentifiers 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?
What is license2?
license.Why is the discord identifier missing?
How do I get the Steam identifier?
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.