Code:
bool:GetFriendID(String:AuthID[], String:FriendID[], size)
{
ReplaceString(AuthID, strlen(AuthID), "STEAM_", "");
if (StrEqual(AuthID, "ID_LAN"))
{
FriendID[0] = '\0';
return false;
}
decl String:toks[3][16];
new upper = 765611979;
new String:temp[12], String:carry[12];
ExplodeString(AuthID, ":", toks, sizeof(toks), sizeof(toks[]));
new iServer = StringToInt(toks[1]);
new iAuthID = StringToInt(toks[2]);
new iFriendID = (iAuthID*2) + 60265728 + iServer;
if (iFriendID >= 100000000)
{
Format(temp, sizeof(temp), "%d", iFriendID);
Format(carry, 2, "%s", temp);
new icarry = StringToInt(carry[0]);
upper += icarry;
Format(temp, sizeof(temp), "%d", iFriendID);
Format(FriendID, size, "%d%s", upper, temp[1]);
}
else
{
Format(FriendID, size, "765611979%d", iFriendID);
}
return true;
}
this is way better than doing big number additions with strings
__________________