Before blaming me that i didn't post in the plugins topic i've checked author's last time online on forum:Alcedema
I tried to modify the plugin to save the demo by name and not steam id. Here's the part of the code:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
new a3r_players[33][3]
new maxplayers,ontarget
new g_menuPosition[33]
new g_menuPlayers[33][32]
new g_menuPlayersNum[33]
public plugin_init() {
register_plugin("a3 record","2.3","A3 Alcedema")
register_clcmd("a3_record","cmdRecordMenu",0,"- displays record menu")
register_clcmd("a3_ac","toggleac",0,"")
register_clcmd("say /ac","toggleac")
register_clcmd("a3_stop","Recordstop",0,"- stops recording a demo")
register_menucmd(register_menuid("Record:"),1023,"actionRecordMenu")
register_clcmd("stop","manualstop")
register_cvar("a3r_revcycle", "0")
register_cvar("a3r_autocycle", "1")
maxplayers = get_maxplayers()
set_task(0.5, "check_spectated", 45421000, "", 0, "b")
set_task(1.0, "check_hudmessage", 45421000, "", 0, "b")
}
public actionRecordMenu(id,key)
{
switch(key){
case 8: displayRecordMenu(id,++g_menuPosition[id])
case 9: displayRecordMenu(id,--g_menuPosition[id])
default:{
new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key]
for(new a = 1; a <= maxplayers; ++a)
{
if (a3r_players[a][1] == player)
{
new line[128], uName[32]
get_user_name(a,uName,31)
format (line, 127, "That player is already being recorded by %s", uName)
set_hudmessage(200, 100, 0, -1.0,0.12, 0,6.0, 6.0, 0.1, 0.2, 3)
show_hudmessage(id, line)
return PLUGIN_HANDLED
}
}
new authid[32],authid2[32],name[32]
get_user_authid(player,authid,31)
get_user_authid(player,authid2,31)
replace (authid2, 31, "STEAM_0:1:", "STEAM_0_1_")
replace (authid2, 31, "STEAM_0:0:", "STEAM_0_0_")
get_user_name(player,name,31)
new timestamp = get_systime()
new demoname[32]
format(demoname, 31, "%s_%d", name)
strtolower(demoname)
log_message("[ A3R ] RECORD for %s", authid)
client_cmd(id,"record %s", demoname)
a3r_players[id][0] = 1
a3r_players[id][1] = player
new AC[4]
if (get_cvar_num("a3r_autocycle") == 1)
{
a3r_players[id][2] = 1
format (AC, 3, "On")
} else {
a3r_players[id][2] = 0
format (AC, 3, "Off")
}
set_task(3.0,"record_sbstatus",id)
set_task(5.0,"record_status",id)
client_print(id,print_chat,"[ A3R ] * Recording %s (%s) to %s.dem *", name, authid, demoname)
client_cmd(id, "amx_chat ** Recording player %s (%s) **", name, authid)
}
It's all fine except if the players has characters ($@^&* etc) or space's in it's name (the killer) so it's saving the demo the.
.
The problem is that i'm a noob and don't know were to put that code in the plugin to work
. Any help appreciated. Thanks.