Hmm, can u record from the actual server? get_user_name 0 i think get's the hostname right? So I don't think that the server can record unless u have HLTV.
Unless u have a player in the server just sitting there like a bot but an actual player who is recording?
So this is what I would do, I'd make it only check once, when the client enters the server, so you don't have a task.
Basically what this does if a person enters and their name is HNS......TV or w/e, it will send the command "record %s", demoname to them obviously not that exact command but w/e. So the person that is recording must be you or someone that you have access to their steam files and stuff. Then it will save the demo to their cstrike folder. Only downfall is that if they get kicked or soemthing, it won't stop recording.
So this is what I got.
Untested:
Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "auto demo recorder"
#define VERSION "2.0 updated"
#define AUTHOR "outsider"
new servername[65];
new demoname[16];
public plugin_init() {
register_plugin(PLUGIN,VERSION,AUTHOR)
}
public client_putinserver(id) {
server(id)
return PLUGIN_CONTINUE
}
public server(id) {
get_user_name(id,servername,64);
if(equali(servername,"JB.RETRY.LV JAILBREAK 47/48p")) {
demoname = "jb_retry_lv";
record_demo(id)
} else if(equali(servername,"HNS.RETRY.LV HIDE AND SEEK 47/48p")) {
demoname = "hns_retry_lv";
record_demo(id)
} else if(equali(servername,"BB.RETRY.LV BASE BUILDER 47/48p")) {
demoname = "bb_retry_lv";
record_demo(id)
} else if(equali(servername,"DD2.RETRY.LV DUST 2 LAND 47/48p")) {
demoname = "dd2_retry_lv";
record_demo(id)
} else if(equali(servername,"CS.RETRY.LV PUBLIC 47/48p")) {
demoname = "cs_retry_lv";
record_demo(id)
} else if(equali(servername,"ZM.RETRY.LV ZM+WAR3 47/48p")) {
demoname = "zm_retry_lv";
record_demo(id)
} else if(equali(servername,"DR.RETRY.LV DEATHRUN 47/48p")) {
demoname = "dr_retry_lv";
record_demo(id)
} else if(equali(servername,"SURF.RETRY.LV SURF 47/48p")) {
demoname = "surf_retry_lv";
record_demo(id)
} else {
demoname = "retry_lv";
record_demo(id)
}
}
public record_demo(id) {
new name[35];
get_user_name(id,name,34);
new userip[20]
get_user_ip(id,userip,19);
new serverip[20]
get_user_ip(0,serverip,19);
client_cmd(id,"stop;record %s",demoname)
client_print(id,print_center,"Recording to %s started...",demoname)
client_print(id,print_chat,"Serveris: %s (%s)",servername,serverip)
client_print(id,print_chat,"Niks: %s | IP: %s",name,userip)
return PLUGIN_CONTINUE
}