Here’s an old piece of code of mine, it used to work in Lua for getting specific identifiers. Feel free to mess with it as you see fit.

Keep in mind if you want the full identifier steam:hex_here and not just hex_here then use the second function I’ve posted.

JUST IDENTIFIERS - license_id

function GetIdentifier(server_id, identifier_type)
    local name = GetPlayerName(server_id) or 'Unknown'
    local identifiers = GetPlayerIdentifiers(server_id) or {}
    local license = nil or 'Unknown'
    local xbl = nil or 'Unknown'
    local live = nil or 'Unknown'
    local discord = nil or 'Unknown'
    local fivem = nil or 'Unknown'
    local ip = nil or 'Unknown'

    for _, identifier in pairs(identifiers) do
        if (string.match(string.lower(identifier), 'steam:')) then
            steam_hex = identifier
        elseif (string.match(string.lower(identifier), 'license:')) then
            license = string.sub(identifier, 9)
        elseif (string.match(string.lower(identifier), 'xbl:')) then
            xbl = string.sub(identifier, 5)
        elseif (string.match(string.lower(identifier), 'live:')) then
            live = string.sub(identifier, 6)
        elseif (string.match(string.lower(identifier), 'discord:')) then
            discord = string.sub(identifier, 9)
        elseif (string.match(string.lower(identifier), 'fivem:')) then
            fivem = string.sub(identifier, 7)
        elseif (string.match(string.lower(identifier), 'ip:')) then
            ip = string.sub(identifier, 4)
        end
    end

    if identifier_type == "steam" then
        return steam_hex
    elseif identifier_type == "license" then
        return license
    elseif identifier_type == "xbl" then
        return xbl
    elseif identifier_type == "live" then
        return live
    elseif identifier_type == "discord" then
        return discord
    elseif identifier_type == "fivem" then
        return fivem
    elseif identifier_type == "ip" then
        return ip
    end
end

FULL IDENTIFIERS | license:license_id

function GetIdentifier(server_id, identifier_type)
    local name = GetPlayerName(server_id) or 'Unknown'
    local identifiers = GetPlayerIdentifiers(server_id) or {}
    local license = nil or 'Unknown'
    local xbl = nil or 'Unknown'
    local live = nil or 'Unknown'
    local discord = nil or 'Unknown'
    local fivem = nil or 'Unknown'
    local ip = nil or 'Unknown'

    for _, identifier in pairs(identifiers) do
        if (string.match(string.lower(identifier), 'steam:')) then
            steam_hex = identifier
        elseif (string.match(string.lower(identifier), 'license:')) then
            license = identifier
        elseif (string.match(string.lower(identifier), 'xbl:')) then
            xbl = identifier
        elseif (string.match(string.lower(identifier), 'live:')) then
            live = identifier
        elseif (string.match(string.lower(identifier), 'discord:')) then
            discord = identifier
        elseif (string.match(string.lower(identifier), 'fivem:')) then
            fivem = identifier
        elseif (string.match(string.lower(identifier), 'ip:')) then
            ip = identifier
        end
    end

    if identifier_type == "steam" then
        return steam_hex
    elseif identifier_type == "license" then
        return license
    elseif identifier_type == "xbl" then
        return xbl
    elseif identifier_type == "live" then
        return live
    elseif identifier_type == "discord" then
        return discord
    elseif identifier_type == "fivem" then
        return fivem
    elseif identifier_type == "ip" then
        return ip
    end
end
1 Like