Missing Player Identifiers

Hi, was working on player joining stuff when stumbled upon an issue with GetNumPlayerIdentifiers()/GetPlayerIdentifier().
Not sure if intended but when running FxDK this function will only print “ip:”, tried building it and runing using main client and everything worked as intended got full identifier list.

Live server output

FxDK server output

A bit troublesome as I can’t test GetPlayerIdentifier() related functionality from within FxDK.

Regards

This is (as of now) intended, you should use sv_fxdkMode console variable to disable any identity checking logic and perhaps to assign yourself an unique ID when in fxdk mode.

You can fetch the value using GetConvar("sv_fxdkMode", false) to see if you are running FxDK.

2 Likes

Thanks, tinkered with it a bit and ran into an odd problem, not sure if fxdk related or just me not understanding convars.

Code Snippet
function GetPlayerLicenseKey(player) {
    if (GetConvar("sv_fxdkMode", false) == "1")
        return "license:7777777777777777777777777777777777777777"
    else
        return getPlayerIdentifiers(player).find(id => id.startsWith("license:"))
}

Works as expected in fxdk

But in live build when sv_fxdkMode is not defined I’m getting this error

As soon as the convar is set, it works again properly. Am I missing something here or in this case I’d have to set it by hand before using in a conditional statement? I had it in my mind that unset convar would just return a nil/false value.

1 Like

Turns out It was just me not understanding convars. :upside_down_face:

Had a quick read through fxdk changelog and found out that I should of used GetConvarInt instead of GetConvar

Fixed Snippet
function GetPlayerLicenseKey(player) {
    if (GetConvarInt("sv_fxdkMode", false))
        return "license:7777777777777777777777777777777777777777"
    else
        return getPlayerIdentifiers(player).find(id => id.startsWith("license:"))
}

All working as expected, hope this helps some future wonderers!

1 Like