Absurd Minds
http://forums.absurdminds.net/

Monitor server and start hltv when human joins
http://forums.absurdminds.net/viewtopic.php?f=58&t=1269
Page 1 of 1

Author:  Amaroq [ 22 Mar 2012 13:38 ]
Post subject:  Monitor server and start hltv when human joins

I have some HLTVs watching various servers. I'd like to be able to write a script that checks the server, say, ever 10 seconds, and if it finds that there is a player connected, automatically starts recording an HLTV demo. If there are no users connected, it would stop the HLTV demo.

Also, if this script could purge HLTV demos after 2 weeks, that would be spectacular.

Author:  J35t3r [ 22 Mar 2012 14:09 ]
Post subject:  Re: Monitor server and start hltv when human joins

ten seconds ?? wouldn't that create a lot of demo files?? that could build up pretty quickly in your mem....

Author:  jero [ 22 Mar 2012 14:27 ]
Post subject:  Re: Monitor server and start hltv when human joins

This exists apparently
http://www.hltv.org/?pageid=204&type=ar

The purge would be simple, again in /etc/crontab for 4AM everyday. This should delete files 14 days old
00 4 * * * /usr/bin/find /hltv/path -mtime +14 -exec rm {} \;

Author:  Amaroq [ 22 Mar 2012 15:09 ]
Post subject:  Re: Monitor server and start hltv when human joins

Quote:
ten seconds ?? wouldn't that create a lot of demo files?? that could build up pretty quickly in your mem....
Oh, maybe... I thought it would be intelligent enough to check and see if one was already recording.

Author:  serialp0rt [ 22 Mar 2012 17:27 ]
Post subject:  Re: Monitor server and start hltv when human joins

and the hltv will be recording to a harddrive here at our place that is either 250 or 500 gigs I forget. we are gonna try to get some good footage from our pubbing to make some videos.

Author:  KamiKaze [ 22 Mar 2012 23:46 ]
Post subject:  Re: Monitor server and start hltv when human joins

will we be able to see the demos?

Author:  Amaroq [ 22 Mar 2012 23:48 ]
Post subject:  Re: Monitor server and start hltv when human joins

Hopefully, if I can get it working.

Author:  Amaroq [ 11 Apr 2012 21:20 ]
Post subject:  Re: Monitor server and start hltv when human joins

I posted this on alliedmodders, and after a few weeks got the most amazing plugin from 8088. I've attached the necessary files, as well as the installation instructions.

Requirements:
  • PHP 5.2.8 or higher, with PDO
  • MySQL 5 or higher
Installation:
  1. extract and upload everything to your web space (preferrably into a directory that is password protected)
  2. create a database and import hlds.sql
  3. edit lib/db.php and change the values of $db_host, $db_user, $db_password and $db_database
  4. open index.php in your browser and start adding/editing your servers
  5. edit the path to db.php in cronjob/cronjob.php if you move conjob.php to a different location (recommended, but not required)
  6. create a cronjob to have cronjob/cronjob.php executed at regular intervals:
    1. this requires the path to db.php to be absolute:
      Code:
      php /path/to/cronjob.php
    2. and this allows for a relative path to db.php:
      Code:
      cd /path/to/cronjob.php && php cronjob.php


Attachments:
hltv (3).zip [19.46 KiB]
Downloaded 326 times

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/