ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
ESXserver

ESX.GetPlayerFromIdentifier

ESX server documentation with a FiveM Lua example.

Summary

Finds an online xPlayer by their identifier (license). Useful when you have a stored identifier rather than a live source.

Returns

table (xPlayer) or nil.

Parameters

identifierstringThe player identifier (e.g. license:...).

Example

local xPlayer = ESX.GetPlayerFromIdentifier('license:abc123')
if xPlayer then
  -- player is online
end

Common pitfalls

  • Only finds ONLINE players; returns nil if they're offline.
  • For offline data, query the database directly.

Related functions

Related guides

FiveM scripts done right

Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.

Browse Scripts →