Player.UniqueID help

The short version is that I run a pair of servers that use the player.uniqueid function to name the save file for each player, and the save files for these 2 servers are synced with a program called Unison. This normally works quite well, but occasionally when someone doesn’t heed the warnings and switches servers too quickly, it can glitch. What I’d like is for a player to be able to give me their SteamID if they report an issue so that I can figure out which file is theirs and take a look/fix it.

Basically, I need a simple way to punch in a SteamID and get the UniqueID hash, but I haven’t seen what I’m looking for in my searches. Has anyone seen something along the lines of what I’m looking for? Thanks in advance.

I took a quick look on the wiki and found this:


util.CRC("gm_" .. ply:SteamID() .. "_gm")

It should convert the player’s SteamID into the UniqueID hash.

– EDIT –
Btw, this should have gone in the questions section.

Yes, I saw that as well (and bear with me as I’m not the coder, I’ll bother him about this when he logs on today), however, from what I can tell, that will return your SteamID hash to you if you start up a multiplayer game or something along those lines, correct? I was hoping to find ideally the algorithm used so I could make/get a friend to make a php script or something for my players to use, or more realistically to find a little lua script where I could enter in the reported SteamID of the user in question and get their SteamID hash back as the output when the script is called, and just edit the SteamID in the script manually as needed, something like that. It seems like a bit much to ask these people who can’t be bothered to read the adverts or warnings on the forums to properly use a lua script to hash their ID for me, you know?

At any rate, thank you for the help: it’s got me thinking, and it’ll be something to show my lua coder buddy when next I see him.

Thanks again, and of course any other help/comments are welcome as well.

Edit: Could something as simple as this work, or would that be too easy?


print(util.CRC( 'STEAM_X:X:XXXXX' ))

Also, sorry about that: I lurk here for answers a lot but have never posted anything before, and I’ve found that most of the answers to my funky lua questions have been found in this forum. Sorry about that.

print(util.CRC(“gm_”…ply:SteamID()…"_gm"))
replace ply:SteamID() with “STEAM_X:X:XXXXX” if you want, they do the same thing.

Thanks! That’s just what I needed.

In case somebody like me searches this up, here’s what you punch into your GMod console:


lua_run print(util.CRC("gm_".."STEAM_X:X:XXXXX".."_gm"))

Thanks again guys.