Well, this is a guide which might be completely useless for some but as you know people here get their steam IDs stored in a way that they can’t be found since no other website uses HEX to find steam IDs.
Well, let’s put up a scenario:
You know a player is attacking your server, you block him on your server but you’d want to see who he is on steam, simply get his HEX steam id from your database, we’ll use mine for example: steam:110000103d27e1d
Well, now that we have that we separate it by removing the steam: part and we are left with the hexadecimal part now: 110000103d27e1d
function GetSteamId64FromHex(hex_id)
local len = string.len(hex_id)
local dec = 0
for i=1,len do
local val = string.sub(hex_id, i, i)
if val == "a" or val == "A" then val = 10*16^tonumber(len-i)
elseif val == "b" or val == "B" then val = 11*16^tonumber(len-i)
elseif val == "c" or val == "C" then val = 12*16^tonumber(len-i)
elseif val == "d" or val == "D" then val = 13*16^tonumber(len-i)
elseif val == "e" or val == "E" then val = 14*16^tonumber(len-i)
elseif val == "f" or val == "F" then val = 15*16^tonumber(len-i)
else val = tonumber(val)*16^tonumber(len-i)
end
dec = dec+math.ceil(val)
end
return dec
end
Never thought i will bump into hexadecimal values, but i made it.
It was hard to understand (for my dump head), but i just followed the instructions to convert hexadecimal values to decimal (with offsets to FiveM server lua version). It is simple (value*16^len-1). And it works on server side!