#include <amxmodx> 

#define PLUGIN "Record Demos" 
#define VERSION "1.0" 
#define AUTHOR "MaCoLa" 

public plugin_init() 
{ 
    register_plugin(PLUGIN, VERSION, AUTHOR); 
    register_clcmd("say /demo", "demostart") 
    register_clcmd("say /record", "demostart") 
    register_clcmd("say /stop", "demoend") 
    register_clcmd("say_team /demo", "demostart") 
    register_clcmd("say_team /record", "demostart") 
    register_clcmd("say_team /stop", "demoend") 
} 

public demostart(id) 
{ 
        new name[33] 
 	new map[33]
        get_user_name(id, name,32)
     	get_mapname ( map,32 ) 
        client_cmd(id, "stop; record %s_%s", name, map)
        client_print(id, print_chat, "Recording to %s_%s.dem", name, map)  
        return PLUGIN_CONTINUE 
} 

public demoend(id) 
{ 
        new name[33] 
 	new map[33]
        get_user_name(id, name,32) 
     	get_mapname ( map,32 ) 
        client_cmd(id, "stop") 
        client_print(id, print_chat, "Recording finished in %s_%s.dem", name, map) 
} 