getPlayerByIdentifier

Returns the player object for the given citizen ID (online or offline).

Parameters:

  • identifier (string): Citizen ID

Returns:

  • table|nil: QBCore player object or nil if not found

Example:

local player = ps.getPlayerByIdentifier('ABC12345')
if player then
    print("Player data:", player.PlayerData.charinfo.firstname)
end

Last updated