GetPlayerIdentifierByType doesn't work [SOLVED]

Hey, From the FiveM API, we have a new way to handle player identification by type, so I want to use it instead of the other way because I’m only looking for the license.

But I’m getting an error that the GetPlayerIdentifierByType function doesn’t exist.

SCRIPT ERROR: @core/server.lua:178: attempt to call a nil value (global ‘GetPlayerIdentifierByType’)

i’m not sure if this is intentional or an oversight.

here is my logic how i use it :

AddEventHandler(
    "playerConnecting",
    function()
        local source = source

        local playerLicense = GetPlayerIdentifierByType(source, 'license')
        exports.core:Logger("info", playerLicense) --> Error attempt to call a nil value (global 'GetPlayerIdentifierByType') 

        InitializeCharacterData(source)
    end
)```

Are you using an old server version that doesn’t support it by chance?
Not quite sure when it got introduced though.

1 Like

I don’t think so, but let me check that to be sure.

I’m running it with the latest recommended version (5848).

You can use

dependencies {
    "/native:0xA61C8FC6"
}

to ensure support for that native. Just use its hex value GetPlayerIdentifierByType - FiveM Natives @ Cfx.re Docs

Works fine with the latest pushed version.

So yeah, it was a build version issue. Build 5848 doesn’t include it.
I will stick with this version, 6497, for now since it works fine. Thanks for helping me figure it out!