View Single Post
Author Message
citkabuto
Junior Member
Join Date: Dec 2009
Old 01-29-2010 , 07:19   [Any] Save player chat to file V1.2.1
Reply With Quote #1

SaveChat

A server admin friend asked me if it was simple to record just player chat messages to a file as he was getting fed up of digging through the main logfiles and didn't want to use a database.

So, I wrote this simple plugin that should work on any Source game. It captures both Say and Say Team commands and formats the output before logging it to a datestamped file.

E.g. logs/chat290110.log

Code:
--=================================================================--
[29/01/2010 10:52:47] --- NEW MAP STARTED: c1m4_atrium ---
--=================================================================--
[10:58:24] [GB] [Infected  ] Dollshead          : (TEAM) Testing team chat
[11:00:23] [GB] [Survivor  ] Citizen Kabuto     : (TEAM) Lovely weather guv!
[11:01:49] [GB] [Spectator ] STALKER            : I reckon we should play
[11:05:15] [GB] [Spectator ] STALKER            : (TEAM) I am a nub!
[11:09:12] [FR] BanjoLovesYa       has joined (STEAM_1:0:10234254 | 69.23.25.163)
[11:15:10] [GB] [Survivor  ] Citizen Kabuto     : Lookout! Banjo's in the house! ;-)
[12:01:29] [  ] [          ] CONSOLE            : You have to be the worst players I've ever seen!


Installation Details

Download the "savechat.smx" and drop into your addons\sourcemod\plugins directory.

Server ConVars
  • sm_savechat_version - Version of SaveChat
  • sm_record_detail - Save team name, Steam ID and IP address of connected players (0=no, 1=yes : default=1)

This has been tested as working on L4D, L4D2 and TF2 servers and should honestly run fine on any Source powered game. Please let me know if you have any issues.

Changes:

V1.2.1
  • Argh! 1.2.0 doesn't work - uploaded wrong version! This one does work!
V1.2.0
  • Records player team (if sm_record_detail is enabled)
  • Now uses proper method of determining player name
V1.1.1
  • Fixed error (client index 0 is invalid) for console issued messages
  • Cleaned up formatting slightly
V1.1.0
  • Added ability to record player SteamID and IP address when connecting
  • Fixed bug with date of file not rolling over correctly
  • Fixed bug with main cvar not registering correctly
V1.0.0
  • Original version
Attached Files
File Type: sp Get Plugin or Get Source (savechat.sp - 5939 views - 5.2 KB)

Last edited by citkabuto; 02-23-2010 at 09:27. Reason: Added team name
citkabuto is offline