From 9c983fbceeea1d3bc4ed4e3dd86e35470fbf4496 Mon Sep 17 00:00:00 2001 From: nomi-nonsz Date: Mon, 11 Aug 2025 22:43:47 +0700 Subject: [PATCH] add client logger --- scripting/admingod.sp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripting/admingod.sp b/scripting/admingod.sp index 8011c58..8e625e8 100644 --- a/scripting/admingod.sp +++ b/scripting/admingod.sp @@ -11,6 +11,20 @@ public Plugin myinfo = { bool g_bGodmode[MAXPLAYERS + 1]; +public void OnClientPutInServer(int client) +{ + if (!IsClientInGame(client) || IsFakeClient(client)) return; + + char name[64]; + char steamID[64]; + GetClientName(client, name, sizeof(name)); + GetClientAuthId(client, AuthId_Steam2, steamID, sizeof(steamID)); + + PrintToServer("[ClientLogger] %s (%s) connected", name, steamID); + + LogAction(client, -1, "%s (%s) has connected to the server", name, steamID); +} + public void OnPluginStart() { RegAdminCmd("sm_quick_noclip", Command_QuickNoclip, ADMFLAG_SLAY|ADMFLAG_CHEATS); RegAdminCmd("sm_god", Command_Godmode, ADMFLAG_SLAY|ADMFLAG_CHEATS);