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

[SOLVED] Converting between steam3 and steam2?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yusufali
Member
Join Date: Feb 2014
Old 09-20-2014 , 16:36   [SOLVED] Converting between steam3 and steam2?
Reply With Quote #1

Im using: [01] SourceMod (1.6.2-dev+4566) by AlliedModders LLC

everything is in steam id 2

except for in event: player_disconnect

string: networkid is steamid3, how can I convert it to steamid2?

can anyone post or link me to a snippet

so from [U:1:190095724] -> STEAM_0:0:95047862
__________________

Last edited by yusufali; 09-20-2014 at 17:56.
yusufali is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 09-20-2014 , 16:53   Re: Converting between steam3 and steam2?
Reply With Quote #2

Old: STEAM_0:A:B
New: [U:1:B*2+A]
Example: STEAM_0:1:1234 ---> [U:1:2469]

https://forums.alliedmods.net/showthread.php?t=246712
KissLick is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 09-20-2014 , 16:55   Re: Converting between steam3 and steam2?
Reply With Quote #3

Code:
stock Steam3To2(const String:in[], String:out[], maxlen)
{
        new m_unAccountID = StringToInt(in[5]);
        new m_unMod = m_unAccountID % 2;
        Format(out, maxlen, "STEAM_0:%d:%d", m_unMod, (m_unAccountID-m_unMod)/2);
}
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus 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 14:01.


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