mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
print steamid to chat when using !profile <otherplayer>
This commit is contained in:
parent
f8f336d21a
commit
4d1a0b5eb3
@ -41,13 +41,20 @@ stock int SteamIDToAccountID(const char[] sInput)
|
||||
return 0;
|
||||
}
|
||||
|
||||
stock void AccountIDToSteamID64(int accountid, int num[2])
|
||||
stock void AccountIDToSteamID64Num(int accountid, int num[2])
|
||||
{
|
||||
num[0] = accountid;
|
||||
// universe | type | instance
|
||||
num[1] = (1 << 24) | (1 << 20) | 1; // 0x01100001
|
||||
}
|
||||
|
||||
stock void AccountIDToSteamID64(int accountid, char[] buf, int buflen)
|
||||
{
|
||||
int num[2];
|
||||
AccountIDToSteamID64Num(accountid, num);
|
||||
SteamID64ToString(num, buf, buflen);
|
||||
}
|
||||
|
||||
stock void AccountIDToSteamID2(int accountid, char[] buf, int buflen)
|
||||
{
|
||||
FormatEx(buf, buflen, "STEAM_0:%d:%d", accountid&1, (accountid>>1) & 0x7FFFFFFF);
|
||||
|
||||
@ -56,6 +56,7 @@ int gI_Style[MAXPLAYERS+1];
|
||||
int gI_MenuPos[MAXPLAYERS+1];
|
||||
int gI_Track[MAXPLAYERS+1];
|
||||
int gI_TargetSteamID[MAXPLAYERS+1];
|
||||
int gI_LastPrintedSteamID[MAXPLAYERS+1];
|
||||
char gS_TargetName[MAXPLAYERS+1][MAX_NAME_LENGTH];
|
||||
|
||||
// playtime things
|
||||
@ -183,6 +184,7 @@ public void OnClientConnected(int client)
|
||||
gF_PlaytimeStyleSum[client] = empty;
|
||||
gB_HavePlaytimeOnStyle[client] = empty;
|
||||
gB_QueriedPlaytime[client] = false;
|
||||
gI_LastPrintedSteamID[client] = 0;
|
||||
}
|
||||
|
||||
public void OnClientPutInServer(int client)
|
||||
@ -1017,6 +1019,16 @@ public void OpenStatsMenuCallback(Database db, DBResultSet results, const char[]
|
||||
|
||||
menu.ExitButton = true;
|
||||
menu.DisplayAt(client, item, MENU_TIME_FOREVER);
|
||||
|
||||
if (GetSteamAccountID(client) != gI_TargetSteamID[client] && gI_LastPrintedSteamID[client] != gI_TargetSteamID[client])
|
||||
{
|
||||
gI_LastPrintedSteamID[client] = gI_TargetSteamID[client];
|
||||
char steam2[40];
|
||||
AccountIDToSteamID2(gI_TargetSteamID[client], steam2, sizeof(steam2));
|
||||
char steam64[40];
|
||||
AccountIDToSteamID64(gI_TargetSteamID[client], steam64, sizeof(steam64));
|
||||
Shavit_PrintToChat(client, "%s: %s%s %s[U:1:%d]%s %s", gS_TargetName[client], gS_ChatStrings.sVariable, steam2, gS_ChatStrings.sText, gI_TargetSteamID[client], gS_ChatStrings.sVariable2, steam64);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user