Raised This Month: $32 Target: $400
 8% 

Steam id 32 In PHP ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
albisse
Member
Join Date: Jun 2017
Old 07-07-2017 , 12:41   Steam id 32 In PHP ?
Reply With Quote #1

Hello !

For my server i want i use the Steam ID so the Steam ID 32 like the Steam id who use source ban.
So i search and i have find that : https://stackoverflow.com/questions/...d64-to-steamid

But if you see the PHP code you can see :
" $steamID = "STEAM_0:" . (string)$steamX . ":" . (string)$steamY; "
So with that you must have steam ID like STEAM_0.
But i have : STEAM_1:02679369

So the Code don't work and i can't find a better code ...


Plz Help me ;)
albisse is offline
Kxnrl
AlliedModders Donor
Join Date: May 2015
Old 07-08-2017 , 02:57   Re: Steam id 32 In PHP ?
Reply With Quote #2

PHP Code:
function ConvertSteamID64To32($oriSteamID64)
{
    
$tsid = array(substr($oriSteamID64, -11) % == 1);
    
$tsid[1] = bcsub($oriSteamID64'76561197960265728');
    if(
bccomp($tsid[1], '0') != 1){
        
$STEAMID '';
    }
    
$tsid[1] = bcsub($tsid[1], $tsid[0]);
    list(
$tsid[1], ) = explode('.',bcdiv($tsid[1], 2), 2);
    
$STEAMID implode(':'$tsid);
    
$STEAMID 'STEAM_0:'.$STEAMID;
    return 
$STEAMID;

__________________
Kxnrl is offline
CamerDisco
AlliedModders Donor
Join Date: Aug 2015
Location: Poland
Old 07-08-2017 , 04:39   Re: Steam id 32 In PHP ?
Reply With Quote #3

https://github.com/sejbr/SIDClib
__________________


Max-Play.pl - the best polish servers
CamerDisco is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 07-08-2017 , 04:48   Re: Steam id 32 In PHP ?
Reply With Quote #4

If we're up for sharing libraries rather than functions, this one has more to offer:

-> https://github.com/xPaw/SteamID.php

Works both with Player and Server Steam ID's etc....
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
albisse
Member
Join Date: Jun 2017
Old 07-08-2017 , 09:11   Re: Steam id 32 In PHP ?
Reply With Quote #5

Yes this is the same " STEAM_0 " this is always " STEAM_0" and no " STEAM_1".
So if i use your script, i cant match to my steam id because i have this stream id " STEAM_1:02679369 " with STEAM_1.
albisse is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-15-2017 , 08:13   Re: Steam id 32 In PHP ?
Reply With Quote #6

The STEAM_0 or STEAM_1 prefix depends on the game, just ignore the first 8 characters when comparing.
__________________
asherkin 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 19:33.


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