I’m currently using this to retrieve name, license, steam and ip when the player connects and discos.
local identifiers = GetPlayerIdentifiers(source)
local playername = GetPlayerName(source)
local license = identifiers[2]
local steamid = identifiers[1]
local ipaddr = identifiers[4]
The issue that I’m having is that it doesn’t always supply the expected info even when it’s the same player(me) connecting. there’s times when not all the variables are populated.
I did a lot of searching and there’s just tons of threads stating that at best, this native doesn’t work well and at worst, is horribly broken. I’ve dug through ban systems but they seem to be using the same thing I am. Is there a better way to get this user info without framework-specific functions or do I just need to get better at using it?
Yes. I believe the method I created a method that reads the first part of the identifier and matches it to a type you pass as an argument could be a better solution?
function GetPlayerIdentifierFromType(type, source)
local identifiers = {}
local identifierCount = GetNumPlayerIdentifiers(source)
for a = 0, identifierCount do
table.insert(identifiers, GetPlayerIdentifier(source, a))
end
for b = 1, #identifiers do
if string.find(identifiers[b], type, 1) then
return identifiers[b]
end
end
return nil
end
--GetPlayerIdentifierFromType("license", playersource)
… and if you don’t, what were you planning on doing with it? You’d need to have some knowledge of scripting to use the code, to those with no knowledge, it just looks like a bunch of characters.