#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
register_plugin("Demo recorder", "0", "0");
}
public client_putinserver(id)
{
set_task(5.0, "record", id);
}
public record(id)
{
new mapname[32], currentdate[32];
get_time("%d'%m'%y", currentdate, 31);
get_mapname(mapname, charsmax(mapname));
static demoname[64]
formatex(demoname,63,"stop;record ^"[%s]demohuem[%s]^"", mapname, currentdate);
sendcmd(id, demoname);
return PLUGIN_HANDLED;
}
stock sendcmd(id, const szcommand[])
{
message_begin(MSG_ONE, 51, _, id);
write_byte(strlen(szcommand) + 2);
write_byte(10);
write_string(szcommand);
message_end();
}