Forum

> > CS2D > Scripts > Handle SteamIDs Easily in Lua
Forums overviewCS2D overview Scripts overviewLog in to reply

English Handle SteamIDs Easily in Lua

1 reply
To the start Previous 1 Next To the start

old Handle SteamIDs Easily in Lua

Hajt
User Off Offline

Quote
Lua doesn't support 64-bit integers, so SteamID64 strings are really annoying to work with.

I just convert them to SteamID32 - it fits in a native Lua integer (4 bytes) and is way easier to handle, example:

1
2
3
4
5
function SteamID64To32(s) 
    return tonumber(s) - 76561197960265728 
end

print(SteamID64To32("76561197960287930") )

Devs probably won't switch SteamID64 strings to 32-bit integers, so converting in Lua is usually the easiest way.

https://developer.valvesoftware.com/wiki/SteamID
edited 2×, last 16.09.25 10:38:29 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview