Raised This Month: $51 Target: $400
 12% 

Convert STEAMID to Steam Community ID


Post New Thread Reply   
 
Thread Tools Display Modes
Toster v2.1
Senior Member
Join Date: Oct 2006
Location: Latvia, Riga
Old 06-29-2012 , 10:27   Re: Convert STEAMID to Steam Community ID
Reply With Quote #311

Just wanted to say thanks for this info~
__________________
I am 52% addicted to Counterstrike. What about you?
Toster v2.1 is offline
Send a message via Skype™ to Toster v2.1
SilentBr
Veteran Member
Join Date: Jan 2009
Old 02-08-2013 , 16:10   Re: Convert STEAMID to Steam Community ID
Reply With Quote #312

Is there a version of steamid converter with all info like steamidconverter.com?

Those steamid.php that I found in this thread, convert only STEAM_ID to community link.

Thanks
SilentBr is offline
rocknroll
Member
Join Date: Mar 2013
Old 03-30-2013 , 11:37   Re: Convert STEAMID to Steam Community ID
Reply With Quote #313

No of these ways to convert are working today. Any suggestions?
rocknroll is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 03-30-2013 , 16:56   Re: Convert STEAMID to Steam Community ID
Reply With Quote #314

Quote:
Originally Posted by rocknroll View Post
No of these ways to convert are working today. Any suggestions?
https://forums.alliedmods.net/showthread.php?t=183443
__________________
11530 is offline
rocknroll
Member
Join Date: Mar 2013
Old 03-31-2013 , 10:30   Re: Convert STEAMID to Steam Community ID
Reply With Quote #315

Quote:
Originally Posted by 11530 View Post
I meant PHP.
Also, found working one:
PHP Code:
    function steamid_to_community($steamid) {
        
$parts explode(':'str_replace('STEAM_''' ,$steamid)); 
        
        
$result bcadd(bcadd('76561197960265728'$parts['1']), bcmul($parts['2'], '2')); 
        
$remove strpos($result,".");
        if(
$remove != false){
            
$result substr($result,0,strpos($result,"."));
        }
        return 
$result;
    } 
$steamid must be without whitespaces, use trim() for that.
rocknroll is offline
usabrad86
Junior Member
Join Date: Jun 2009
Location: Florida
Old 05-14-2013 , 12:39   Re: Convert STEAMID to Steam Community ID
Reply With Quote #316

i have converted your snippit to javascript, But it doesent work. can someone give me some advice?

Code:
function SteamToInt(steamid)
{	
    var authserver;
	var authid;

	authserver = steamid.substr(8,1);
	authid = steamid.substr(10);
	return 76561197960265728+(authid*2)+authserver;
}
function IntToSteam(communityid)
{	
    var ret;
	var authserver;
	var authid;
    
    communityid = communityid-76561197960265728;
	authserver = communityid % 2;
    communityid = communityid-authserver;
	authid = communityid/2;
	return "STEAM_0:"+authserver+":"+authid;
}

Last edited by usabrad86; 05-14-2013 at 12:41.
usabrad86 is offline
Send a message via AIM to usabrad86
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 05-14-2013 , 13:59   Re: Convert STEAMID to Steam Community ID
Reply With Quote #317

JavaScript doesn't support 64-bit integers, you need a library like bignum.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.

Last edited by DJ Tsunami; 05-14-2013 at 14:03.
DJ Tsunami is offline
rautamiekka
Veteran Member
Join Date: Jan 2009
Location: Finland
Old 09-02-2013 , 18:11   Re: Convert STEAMID to Steam Community ID
Reply With Quote #318

The MySQL codes aren't working for me when run from phpMyAdmin: I have a testing database for stuff where I first tried devicenull's several times, then Stinkyfax's (http://forums.alliedmods.net/showpos...&postcount=306, both visible in that post), yet I get the same code in second, regular textbox without coloring and no lines anywhere saying if it failed or succeeded, and when checked from routines tab it says there are none.

Running MySQL 5.5.32, pMA 4.0.5, and logged into pMA as MySQL's Root.
__________________
Links to posts I received Karma from:
Big thanks to all who gave Karma
rautamiekka is offline
Send a message via ICQ to rautamiekka Send a message via AIM to rautamiekka Send a message via MSN to rautamiekka Send a message via Yahoo to rautamiekka Send a message via Skype™ to rautamiekka
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 09-02-2013 , 20:45   Re: Convert STEAMID to Steam Community ID
Reply With Quote #319

FWIW there's GetSteamAccountID, which gives you the unique 32bit account id that is unique.
KyleS is offline
V1SoR
Member
Join Date: Jan 2011
Old 01-23-2014 , 08:02   Re: Convert STEAMID to Steam Community ID
Reply With Quote #320

Steam Community ID calculator(within int32)
PHP Code:
SteamIDToCommunityID(String:CommunityID[], size, const String:SteamID[])
{
    
decl String:buffer[3][32];
    
ExplodeString(SteamID":"buffer332);
    new 
accountID StringToInt(buffer[2]) * StringToInt(buffer[1]);

    
IntToString((accountID 60265728), CommunityIDsize);

    if (
accountID >= 39734272)
    {
        
strcopy(CommunityIDsizeCommunityID[1]);
        
Format(CommunityIDsize"765611980%s"CommunityID);
    }
    else
    {
        
Format(CommunityIDsize"765611979%s"CommunityID);
    }

V1SoR is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode