Raised This Month: $51 Target: $400
 12% 

[CS:GO] Simple GOTV record on ban (v2.1)(19/02/16)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Deathknife
Senior Member
Join Date: Aug 2014
Plugin ID:
5046
Plugin Version:
2.1
Plugin Category:
Server Management
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 02-19-2016 , 12:14   [CS:GO] Simple GOTV record on ban (v2.1)(19/02/16)
    Reply With Quote #1

    [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/ !!!
    Attached Files
    File Type: smx gotv-recorder.smx (7.3 KB, 1163 views)
    File Type: sp Get Plugin or Get Source (gotv-recorder.sp - 1092 views - 6.3 KB)

    Last edited by Deathknife; 04-12-2016 at 18:18.
    Deathknife is offline
    Husker
    Member
    Join Date: Feb 2016
    Location: Earth
    Old 02-19-2016 , 12:15   Re: [CS:GO] Simple GOTV record on ban (19/02/16)
    Reply With Quote #2

    This is amazing, definitely going to use it on all of my servers! Thanks a fuckton

    Last edited by Husker; 02-19-2016 at 12:18.
    Husker is offline
    Geryha
    Junior Member
    Join Date: Oct 2015
    Location: Norway
    Old 02-20-2016 , 17:38   Re: [CS:GO] Simple GOTV record on ban (v2.1)(19/02/16)
    Reply With Quote #3

    I'm pretty new to sourcemod, but can you elaborate on how to do this :-)? Send me a PM or answer to this message if you feel like it!
    __________________
    Press one of the images to connect.

    Geryha is offline
    skinheadxtreme
    AlliedModders Donor
    Join Date: Jul 2013
    Old 03-05-2016 , 09:00   Re: [CS:GO] Simple GOTV record on ban (v2.1)(19/02/16)
    Reply With Quote #4

    have you found a workaround for the problem?
    skinheadxtreme is offline
    haho_maniac
    Junior Member
    Join Date: Feb 2012
    Old 03-20-2016 , 05:31   Re: [CS:GO] Simple GOTV record on ban (v2.1)(19/02/16)
    Reply With Quote #5

    ERROR: Tried to SetParentAttachment for entity info_particle_system (CSGOParticle), but it has no attachment named forward.
    ERROR: Tried to SetParentAttachment for entity info_particle_system (CSGOParticle), but it has no attachment named forward.
    ERROR: Tried to SetParentAttachment for entity info_particle_system (CSGOParticle), but it has no attachment named forward.
    ERROR: Tried to SetParentAttachment for entity info_particle_system (CSGOParticle), but it has no attachment named forward.
    L 03/20/2016 - 11:24:10: [sourcebans.smx] "ivanpetelov<4><STEAM_1:05042157><>"
    banned "-ReSpAwN-<3><STEAM_1:1:96224511><>" (minutes "10") (reason "Team Flashi
    ng")
    Dropped -ReSpAwN- from server: You have been banned by this server, check http:/
    /www.csultimate.org for more info

    Hello, I am trying to use this plugin but no demo is recorded. First I tried with the compiled plugin without the ftp transfer. No demos folder was created. Then I created the folder but no demos are recorded. Then I decided to compile the plugin but the result is no different.
    haho_maniac is offline
    JustCallMeLuke
    Member
    Join Date: Dec 2015
    Old 03-30-2016 , 18:51   Re: [CS:GO] Simple GOTV record on ban (v2.1)(19/02/16)
    Reply With Quote #6

    Well curl broke completely for me and i couldn't even start the damn plugin since it kept demanding it -_-.
    Playing with it a bit atm and stripping it down. Can get to write a file in /csgo/demos without compression. Yet with or without they are corrupt for some reason. IDK if its what i've been doing
    -Couldn't be bothered to stick in a .sp
    (Also I'm new to this, i really have no idea what im doing yet i do know what some sections of code mean/are and can modify them)
    Code:
    /************************************************************************
     *		This plugin saves GOTV recording when ban is issued				*
     *		It's up to you to have GOTV setup correctly						*
     *																		*
     *		It's recommended you have delay set. E.g 3minutes				*
     *																		*
     *		This is built for sourcebans, others might work					*
     *																		*
     *		This is in experimental stage. Just something I put together in	*
     *		couple of minutes												*
     *																		*
     *		Saves demos in csgo/demos/TIME-AUTH								*
     *																		*
     *		Yeah code is awful. Not 100% chance to work						*
     *		I might be working on this to improve it...						*
     ***********************************************************************/
     //Some 'extensions' that you can enable disable
    #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 0		//Compression level to use for BZ2
    //Note: It will only delete files if it successfuly compressed/uploaded
    
    #pragma semicolon 1
    
    #define PLUGIN_AUTHOR "Deathknife"
    #define PLUGIN_VERSION "2.00"
    
    #include <sourcemod>
    #include <sdktools>
    #if defined UploadFTP
    #endif
    #if defined compress
    #endif
    
    public Plugin myinfo = 
    {
    	name = "GOTV BAN RECORDER",
    	author = PLUGIN_AUTHOR,
    	description = "",
    	version = PLUGIN_VERSION,
    	url = ""
    };
    
    public Action OnBanClient(int client, int time, int flags, const char[] reason, const char[] kick_message, const char[] command, any source) {
    	//Get authid. One to store in pack, other for path
    	char authid[32];
    	char szauthid[32];
    	GetClientAuthId(client, AuthId_Steam2, authid, sizeof(authid));
    	strcopy(szauthid, sizeof(szauthid), authid);
    	
    	//A file cannot cointain :
    	ReplaceString(szauthid, sizeof(szauthid), ":", " ");
    	
    	//Foramt path
    	static char timestring[42];
    	static char path[PLATFORM_MAX_PATH];
    	FormatTime(timestring, sizeof(timestring), "%Y-%m-%d %H-%M-%S");
    	FormatEx(path, sizeof(path), "/demos/%s %s", timestring, szauthid);
    	
    	//Execute tv_record and immediately after tv_stoprecord
    	ServerCommand("tv_record \"%s\"; tv_stoprecord", path);
    	//Create pack
    	Handle pack = CreateDataPack();
    	Format(path, sizeof(path), "%s.dem", path);
    	WritePackString(pack, path);
    	WritePackString(pack, authid);
    	
    	//Create timer before proceeding -> allows demo to save.
    	//It doesn't take 3 seconds, probably 0.1sec would be enough
    	CreateTimer(0.5, ProceedFile, pack);
    }
    
    public Action ProceedFile(Handle timer, any pack) {
    	ResetPack(pack);
    	char path[PLATFORM_MAX_PATH];
    	ReadPackString(pack, path, sizeof(path));
    	CloseHandle(pack);
    }
    __________________
    It's just a prank bro
    Cameras over there.

    Last edited by JustCallMeLuke; 03-30-2016 at 18:53.
    JustCallMeLuke is offline
    JustCallMeLuke
    Member
    Join Date: Dec 2015
    Old 03-31-2016 , 07:59   Re: [CS:GO] Simple GOTV record on ban (v2.1)(19/02/16)
    Reply With Quote #7

    UPDATE:
    I actually got it to work!
    This version requires no extra includes or extensions, Since those optional extras are actually required -_-.
    This version will write it in /csgo/addons/sourcemod/demos under a bzip (IDK why cause I disabled it but oh well)
    The old code worked, but what was wrong?
    THE FILE NAME
    I Actually don't believe that the file name would screw something up so badly, but it did. So I had to modify it to say renamethistomakeitwork at the start so a basic end user would get it...
    I think this is down to the file name being to long, but im unsure. With a the prefix i used it tells the end user they need to change the file name to make it work. Simple.
    Author, please fix -_-. And just make a non EasyFTP/cURL version since they don't work so well. Maybe even a non-bzip2 version.
    -
    Anyway, it will write in a directory that makes more sense /addons/sourcemod/demos
    So here is the modifed version guys. Enjoy!
    (Tell me if there is problems, it works for me)
    BTW, This works best with SMAC AutoDemo, which auto-configures the GOTV server for you.
    https://forums.alliedmods.net/showthread.php?p=1861742
    Attached Files
    File Type: sp Get Plugin or Get Source (gotv-recorderModified.sp - 1348 views - 3.2 KB)
    File Type: smx gotv-recorder.smx (4.7 KB, 507 views)
    __________________
    It's just a prank bro
    Cameras over there.

    Last edited by JustCallMeLuke; 03-31-2016 at 08:12.
    JustCallMeLuke is offline
    HFKoKoOo
    Junior Member
    Join Date: Nov 2015
    Old 04-09-2016 , 07:12   Re: [CS:GO] Simple GOTV record on ban (v2.1)(19/02/16)
    Reply With Quote #8

    Whats settings i need to change in sp to make the plugin to upload demos in sourcebans.
    __________________

    HFKoKoOo is offline
    MAMAC
    AlliedModders Donor
    Join Date: Nov 2011
    Location: Space
    Old 04-10-2016 , 18:59   Re: [CS:GO] Simple GOTV record on ban (v2.1)(19/02/16)
    Reply With Quote #9

    Quote:
    Originally Posted by JustCallMeLuke View Post
    UPDATE:
    I actually got it to work!
    This version requires no extra includes or extensions, Since those optional extras are actually required -_-.
    This version will write it in /csgo/addons/sourcemod/demos under a bzip (IDK why cause I disabled it but oh well)
    The old code worked, but what was wrong?
    THE FILE NAME
    I Actually don't believe that the file name would screw something up so badly, but it did. So I had to modify it to say renamethistomakeitwork at the start so a basic end user would get it...
    I think this is down to the file name being to long, but im unsure. With a the prefix i used it tells the end user they need to change the file name to make it work. Simple.
    Author, please fix -_-. And just make a non EasyFTP/cURL version since they don't work so well. Maybe even a non-bzip2 version.
    -
    Anyway, it will write in a directory that makes more sense /addons/sourcemod/demos
    So here is the modifed version guys. Enjoy!
    (Tell me if there is problems, it works for me)
    BTW, This works best with SMAC AutoDemo, which auto-configures the GOTV server for you.
    https://forums.alliedmods.net/showthread.php?p=1861742

    i do everything, set smac autodemo plugin and set all settings in server.cfg from first page, your plugin make folder demo (that mean he work ok) but when i ban myself folder stay emty
    MAMAC is offline
    Send a message via MSN to MAMAC Send a message via Yahoo to MAMAC
    Sketchy
    Senior Member
    Join Date: Nov 2010
    Old 04-11-2016 , 08:57   Re: [CS:GO] Simple GOTV record on ban (v2.1)(19/02/16)
    Reply With Quote #10

    While I still haven't managed to get it to fully work yet, when using the plugin from the DL in the OP, I can get the plugin to load fine, and it does make a "demos" folder in the csgo folder, and it does in fact save a demo file their when I ban someone/myself.

    The names that the demo files are given, contain spaces, and that seems to cause issues with demo playback. As for getting the demo's to upload to my SB site, or how to have the demo's automatically be tied to the ban, those parts I currently have no idea how to do. How exactly is one supposed to configure the plugin? I've never seen a plugin where I had to edit options this way...

    edit: Also, after I extract them from the .bzips, the demo's that I end up with are all ~650kb in size and always only ~15 seconds in length. I can't seem to get them to be longer demo's. tv_delay is set to 300 and I've tried other settings.
    My GOTV Settings

    Last edited by Sketchy; 04-11-2016 at 10:35.
    Sketchy is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 11:13.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode