add client logger
All checks were successful
ci/woodpecker/push/test-build Pipeline was successful

This commit is contained in:
Nomi Nonsense (Nonszy) 2025-08-11 22:43:47 +07:00
parent 317cefeb95
commit 9c983fbcee

View File

@ -11,6 +11,20 @@ public Plugin myinfo = {
bool g_bGodmode[MAXPLAYERS + 1]; 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() { public void OnPluginStart() {
RegAdminCmd("sm_quick_noclip", Command_QuickNoclip, ADMFLAG_SLAY|ADMFLAG_CHEATS); RegAdminCmd("sm_quick_noclip", Command_QuickNoclip, ADMFLAG_SLAY|ADMFLAG_CHEATS);
RegAdminCmd("sm_god", Command_Godmode, ADMFLAG_SLAY|ADMFLAG_CHEATS); RegAdminCmd("sm_god", Command_Godmode, ADMFLAG_SLAY|ADMFLAG_CHEATS);