Re: Convert STEAMID to Steam Community ID
This is a snippet I wrote for sourcepawn, but I won't use anymore.
Will convert Steam64 string to steam32 int Don't even know if this will be of use for anyone. This was built based on this PHP Code:
|
Re: Convert STEAMID to Steam Community ID
Don't mean to bump an oldish thread but this might save someone a tiny bit of time later....
Here is the Sourcemod adaption of YamiKaitou's code here with asherkin's tip: https://forums.alliedmods.net/showpo...&postcount=341 https://forums.alliedmods.net/showpo...&postcount=342 So far its passed all my tests but let me know if you find any issues. PHP Code:
|
Re: Convert STEAMID to Steam Community ID
Hey guys, how can i convert U:1:0 to STEAM:1:0?
From steamID3 to steamID |
Re: Convert STEAMID to Steam Community ID
Quote:
1532443 / 2 = 766221,5 Since the number is odd, it is then "STEAM_1:1:766221". If the number was didn't give an odd number, e.g. "766221", it would have been "STEAM_1:0:766221" |
Re: Convert STEAMID to Steam Community ID
Quote:
|
Re: Convert STEAMID to Steam Community ID
Quote:
If you want the "status" command to show different output, you need to create a plugin that does it exactly as you want. If you have any other plugins showing the one where you want the other, you need to adjust those plugins yourself, or hire someone to do it for you. |
Re: Convert STEAMID to Steam Community ID
Note that the number 76561197960265728 looks like a constant, but it really isn't.
This doesn't really matter if you're converting SteamId2 to SteamId64 because SteamId2 only supports individual user accounts. However, SteamId3 also contains the account type and (optionally) instance ID. The correct calculation for Community IDs: Code:
((universe << 56) | (accountType << 52) | (instance << 32) | accountId) Code:
((1L << 56) | (1L << 52) | (1L << 32)) (L is there because 64-bit literals need it in the language I was using to double check this.) If you try this to get group profile IDs or game server profile IDs, it fails spectacularly because they use different account types and instances. Side note: The second section of a SteamId2 is the lowest bit of the account ID and the third section is the remaining 31 bits of the account ID. Hence, to get the account ID, it's ((third section << 1) | second section) |
Re: Convert STEAMID to Steam Community ID
Quote:
|
Re: Convert STEAMID to Steam Community ID
Quote:
|
All times are GMT -4. The time now is 06:00. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.