added a stringmap to store steam ID's so during plugins lifetime it only shows the menu once when connecting

This commit is contained in:
jenz 2026-05-17 13:36:06 +02:00
parent 61568dc032
commit 890e2e1418

View File

@ -5,6 +5,7 @@
Database g_hDatabase; Database g_hDatabase;
char g_cTimeRecords[18][256]; char g_cTimeRecords[18][256];
StringMap g_SteamIDShown;
public Plugin myinfo = public Plugin myinfo =
{ {
@ -17,6 +18,7 @@ public Plugin myinfo =
public void OnPluginStart() public void OnPluginStart()
{ {
g_SteamIDShown = new StringMap();
if (!g_hDatabase) if (!g_hDatabase)
{ {
Database.Connect(SQL_OnDatabaseConnect, "unloze_playtimestats"); Database.Connect(SQL_OnDatabaseConnect, "unloze_playtimestats");
@ -137,5 +139,14 @@ public void OnClientPostAdminCheck(int client)
{ {
return; return;
} }
char steamId[64];
GetClientAuthId(client, AuthId_Steam2, steamId, sizeof(steamId));
bool nothing;
if (g_SteamIDShown.GetValue(steamId, nothing))
{
return;
}
Command_topactivity(client, 0); Command_topactivity(client, 0);
g_SteamIDShown.SetValue(steamId, 1);
} }