Raised This Month: $ Target: $400
 0% 

[Solved] Demo record saved by name


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
aNt1
Member
Join Date: Jul 2008
Location: trance energy
Old 09-07-2008 , 10:31   [Solved] Demo record saved by name
Reply With Quote #1

Before blaming me that i didn't post in the plugins topic i've checked author's last time online on forum:Alcedema
Last Activity: 10th Jan 2007 02:23.

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 
8displayRecordMenu(id,++g_menuPosition[id])
   case 
9displayRecordMenu(id,--g_menuPosition[id])
   default:{
   new 
player g_menuPlayers[id][g_menuPosition[id] * key]
   for(new 
1<= maxplayers; ++a)
   {
    if (
a3r_players[a][1] == player)
    {
     new 
line[128], uName[32]
     
get_user_name(a,uName,31)
     
format (line127"That player is already being recorded by %s"uName)
     
set_hudmessage(2001000, -1.0,0.120,6.06.00.10.23)
     
show_hudmessage(idline)
     return 
PLUGIN_HANDLED
    
}
   }
   new 
authid[32],authid2[32],name[32]
   
get_user_authid(player,authid,31)
   
get_user_authid(player,authid2,31)
   
replace (authid231"STEAM_0:1:""STEAM_0_1_")
   
replace (authid231"STEAM_0:0:""STEAM_0_0_")
   
get_user_name(player,name,31)
   new 
timestamp get_systime()
   new 
demoname[32]
   
format(demoname31"%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 
(AC3"On")
    } else {
    
a3r_players[id][2] = 0
    format 
(AC3"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 *"nameauthiddemoname)
   
client_cmd(id"amx_chat ** Recording player %s (%s) **"nameauthid)
 
  } 
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 solution was found by XxAvalanchexX here.
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.

Last edited by aNt1; 09-07-2008 at 15:15.
aNt1 is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode