Hello. Nice plugin izy, but it had not enough functionality in my eyes. There is this russian dude who wrote "auto_demo_recorder.sma", but the code was so terrible, I had to puke.
Nevermind.
You stated that there is no possible method to get if the player has really started recording. I did some message tracing and when I hit record the following messages are send to the player:
Code:
ResetHUD(79)(OneReliable, 0, -1253463708)();
Money(102)(OneReliable, 0, -1253463708)(int64:800, byte:0);
StatusIcon(107)(OneReliable, 0, -1253463708)(byte:0, string:"c4");
ScoreAttrib(84)(OneReliable, 0, -1253463708)(byte:1, byte:0);
RoundTime(101)(OneReliable, 0, -1253463708)(int16:263);
TeamScore(87)(OneReliable, 0, -1253463708)(string:"CT", int16:0);
TeamScore(87)(OneReliable, 0, -1253463708)(string:"TERRORIST", int16:0);
Health(70)(OneReliable, 0, -1253463708)(byte:100);
Battery(72)(OneReliable, 0, -1253463708)(int16:0);
Train(73)(OneReliable, 0, -1253463708)(byte:0);
CurWeapon(66)(OneReliable, 0, -1253463708)(byte:1, byte:16, byte:12);
ADStop(128)(OneReliable, 0, -1253463708)();
But I don't think this is a good way to check if the demo has really been started recording (I mean catching the message). There must be some other, more decent trigger. we can use.
I took the liberty to add an Lithuanian translation and rewrote your code completely, the translation and the code is available @
http://github.com/txdv/sixplugins/tree/amx_demorecorder
The demo file name is now constant and consists of steamid, nickname, map, time, data, hostname, a custom prefix (can be set by amx_demo_prefix)
The cvars are now:
amx_demo (1|0)
Turn plugin on or off
amx_demo_start_time 15
*How long to wait before starting the demo"
amx_demo_msg (1|0)
Turn message which informs the user on or off
amx_demo_msg_prefix "AMXX"
Modify the string in the brackets: [AMXX] demo has been ...
amx_demo_prefix "AMXX"
Modify the prefix of the filename, usefull if you want to leave your servers name or smth
amx_demo_log (1|0)
enable logging into the amxmodx logs which can be found at addons/amxmodx/logs/
amx_admin_immunity (1|0)
turn on *immunity* for admins, wont issue the record command on admins
Should I open up another forum thread for this plugin? Or do you want to commit the changes in here?