[WARNING]
GOTV demos lag when stopping with delay on. This can lag your server out for couple of seconds or minor lagspikes. Yes, this will make your server lag whenever someone is banned. I don't recommend you to use it.
Based on:
https://forums.alliedmods.net/showthread.php?t=279234
Description
Whenever a client is banned, it creates a demo of the last X minutes up to the point where he's banned. Optionally compresses, uploads to ftp and adds to sourcebans as a demo. This doesn't delay the actual ban. (X=tv_delay). Built for CS:GO, but CS:S might work.
Requirements
GOTV enabled (autorecord can be off)
Optional Requirements
tEasyFTP
bzip2
curl
Configuration
Setup gotv, with relay on. Something like this:
PHP Code:
tv_enable "1"
tv_relayvoice "1"
tv_autorecord "0"
tv_maxclients "1"
tv_delay "300"
Plugin configuration(change then compile)
PHP Code:
#define UploadFTP //Requires tEasyFTP + curl - Uploads to FTP (config 'demos')
#define Sourcebans //Adds the demo to the ban (UploadFTP needs to be enabled!)
#define sbprefix "sb" //Sourcebans prefix
#define compress //Compress
#define RemoveUncompressed //Remove uncompressed file after compressing
#define RemoveAfterUpload //Remove the demo(compressed if enabled) after uploading to FTP
#define CompressLevel 9 //Compression level to use for BZ2
It will only remove files if it was successful compression/upload.
For FTP, create tEasyFTP config "demos" and make sure it leads to the demos folder you want. For sourcebans its sourcebans dir/demos/
That's about it. Make sure to test it if it works before putting it on live server, the code is awful and not necessarily fully optimized.
Thanks to k0nan for idea and testing it out.
Thanks to Coolpwner for testing.
And thanks to the creators of the tEasyFTP, curl & bzip2.
Summary
To summarize it, GOTV constantly "records" and has a "memory" of last (tv_delay) seconds. Whenever a ban takes place, it saves that "memory" to a demo and, optionally, uploads to ftp and adds it to sourcebans as a demo to the ban. This doesn't delay the ban. If your tv_delay is 180, it would save the 3 minutes before the ban took place, all the way to the point when the player was banned.
Very simple concept, I put it together in couple of minutes so the code is redundant. It works though.
New in v2.1
*Plugin will now create the directory "demos" inside your csgo folder automatically.
Note: You might have to create "demos" folder manually inside your csgo/ !!!