Jump to content

Определение CommunityID (SteamID64)


Recommended Posts

Posted

Т.к SourcePawn не поддерживает 64 разрядные числа, то обошлись выводом через строку. Взято и доработано  http://forums.alliedmods.net/showthread.php?s=8bd8adb190d7cd9f933021b8919dfcb6&t=183443 '>отсюда

 

Source / Код:

stock GetCommunityID(const String:AuthID[], String:FriendID[], size)
{
        if(strlen(AuthID) < 11 || AuthID[0]!='S' || AuthID[6]=='I')
	{
		FriendID[0] = '\0';
		return -1;
	}
	
	if(strlen(AuthID) > 18) // отсекаем пиратов  у них нет странички в стиме :)
	{
		FriendID[0] = '\0';
		return -2;
	}

	new iUpper = 765611979;
	new iFriendID = StringToInt(AuthID[10])*2 + 60265728 + AuthID[8]-48;

	new iDiv = iFriendID/100000000;
	new iIdx = 9-(iDiv ? iDiv/10+1 : 0);  
	iUpper += iDiv;
	
	IntToString(iFriendID, FriendID[iIdx], size-iIdx);
	iIdx = FriendID[9];
	IntToString(iUpper, FriendID, size);
	FriendID[9] = iIdx;

	return 1;
}  

Данный сток нашел отличное применение на Mega Survival в панели информации об объекте где можно было перейти на профиль хозяина объекта если он лицензия :3.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...