View Single Post
Author Message
urus
Senior Member
Join Date: Jan 2007
Old 03-31-2008 , 13:17   SourceTV admin demorecord (sb_status/status support)
Reply With Quote #1


Click image for larger version

Name:	demorec.jpg
Views:	5989
Size:	87.3 KB
ID:	25164


Log Example

Quote:
L 03/31/2008 - 18:25:19: Admin <testadmin> <STEAM_0:0:xxxxxxx> start record a demo 2008.03.31_18-25-de_dust2 (7 minutes)
L 03/31/2008 - 18:32:18: Demo record stopped on time elapsed
L 03/31/2008 - 18:32:18: -----------------------------------
L 03/31/2008 - 18:33:46: Admin <testadmin> <STEAM_0:0:xxxxxxx> start record a demo 2008.03.31_18-33-de_dust2 (20 minutes)
L 03/31/2008 - 18:36:33: Admin "testadmin<3><STEAM_0:0:xxxxxxx><>" stopped record a demo
L 03/31/2008 - 18:36:33: -----------------------------------
L 03/31/2008 - 18:37:12: Admin <testadmin> <STEAM_0:0:xxxxxxx> start record a demo 2008.03.31_18-37-de_dust2 (10 minutes)
L 03/31/2008 - 18:38:14: Stop recording demo on ClientDiscconnect
L 03/31/2008 - 18:38:14: -----------------------------------
Description

This is admin tool for sourceTV demo recording. As example it`s good for silently catch cheaters.
Demo record will autostop if time elapsed or if admin leave server (can be disabled by cvar).
Demo record can stop only that admin who has begun record.
Admin rights for use this plugin is o (Admin_Custom1).


Requirements

Enabled SourceTV on server (tv_enable 1)


Console commands
  • demorec - display menu for record, stop, check status (bypass admin menu)
  • demorecon - command for start record with user defined time in minutes (demorecon 3/demorecon 12, etc)
  • demorecoff - command for stop record
  • demodump - send sb_status or status* command to sourceTV


Cvars
  • demorec_times -comma delimited! Time in minutes for record time menu. You can edit/delete/add your own time. Max 14 items! (default value "0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60")
  • demorec_status - this option determines if sb_status or status command can be executed while recording a demo (0 - disable; 1 - sb_status; 2 - status*; default value "0")
  • demorec_status_time - time in seconds (after record start) when sb_status/status will be executed (0 - disable; default value "0")
  • demorec_onadmin_leave - should demo record autostop when admin disconnect from server (0 - disable; default value "1")
  • demorec_folder - directory where server store demos. If this cvar empty, demos will store in root directory (cstrike, dod, tf, etc.). If you fill this cvar you must create folder in mod's root directory with the same name! (default value "")
  • demorec_log -enable/disable logging to a file demorec.log (default value "1")


Installation

1. Copy srctv_demorec.smx into sourcemod\plugins folder
2. Copy plugin.demorecord.txt into sourcemod\translations folder
3. Optional: change setting in mod_folder\cfg\sourcemod\plugin_demorec.cfg (this file will be automatically created after first plugin load)
4. Optional: if you fill cvar demorec_folder then create folder in mod's root directory with the same name. For linux users - srcds must have write access to this folder.


* about status command

It fake status command.
I just send information in SourceTV`s chat (PrintToChat). See screenshot.

Q: Ок, why you don`t use PrintToConsole?
A: Because SourceMod terminate PrintToConsole message which was send to a bot:

Code:
static cell_t sm_PrintToConsole(IPluginContext *pCtx, const cell_t *params)
{
       bla-bla.....

       /* Silent fail on bots, engine will crash */
       if (pPlayer->IsFakeClient())
      {
        return 0;
      }

      bla-bla.....
}

Changelog:

0.4
cleanup and optimize code

added commands:
demorec
demodump

added cvars:
demorec_times
demorec_status
demorec_status_time
demorec_onadmin_leave
demorec_folder
demorec_log

slightly changed demo names - dots (.) replaced with dash (-)
translation file updated!

0.3
Integrated into sm_admin menu (server commands tab)
Added infinite demo record (command demorecon 0)
Now demo can be recorded from server console (command demorecon)
translation file updated!

0.1
Release


Function for check status taken from warmup plugin
Attached Files
File Type: smx srctv_demorec.smx (10.4 KB, 1756 views)
File Type: sp Get Plugin or Get Source (srctv_demorec.sp - 2424 views - 17.7 KB)
File Type: txt plugin.demorecord.txt (3.1 KB, 2007 views)
__________________

Last edited by urus; 07-22-2010 at 06:40.
urus is offline