AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Auto record demo. (https://forums.alliedmods.net/showthread.php?t=46162)

dzverg 10-20-2006 06:24

Auto record demo.
 
PHP Code:

#include <amxmodx> 
#include <cstrike> 
new mapnamez[32]
new 
demonamez[255]
new 
valuez[2]
new 
datez[32]
get_mapname(mapnamez,32)
get_time("%y%m%d%H%M",datez,32)
public 
plugin_init() 
 { 
  
register_plugin("Ademo""0.01""zZz"
   } 
   public 
client_putinserver(id
    { 
     
callbackCvarValue(id_autorecordvaluez)
     if (
valuez 0
      { 
       
format(demonamez255"record %s%s.dem",datez,mapnamez)
       
client_cmd(iddemonamez
      } 
    }
   }
 } 

Tell me please, is everything all right with this script?
1. I want to know about command "callbackCvarValue". would it work with variable "setinfo "_autorecord" "1", which is set on client?

jim_yang 10-20-2006 07:31

Re: Auto record demo.
 
Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Test" #define VERSION "0.0" #define AUTHOR "test" static mapname[32] public plugin_init() {         register_plugin(PLUGIN, VERSION, AUTHOR)         get_mapname(mapname, 31) } public client_putinserver(id) {         new value[2]         get_user_info(id, "_autorecord", value, 1)         if(equal(value, "1"))         {                 new timedata[32], demoname[100]                 get_time("%y%m%d%H%M", timedata, 31)                 format(demoname, 99, "%s%s.dem", timedata, mapname)                 client_cmd(id, "record", "%s", demoname)         }         return PLUGIN_CONTINUE }

Silencer123 10-20-2006 08:34

Re: Auto record demo.
 
Correcting jim_yang... ^^
Code:
#include <amxmodx> #include <amxmisc> #define VERSION "1.0" static mapname[32] public plugin_init() {         register_plugin("Auto Record", VERSION, "dzverg")         get_mapname(mapname, 31) } public client_putinserver(id) {         new value[2]         get_user_info(id, "_autorecord", value, 1)         if(equal(value, "1"))         {                 new timedata[32], demoname[100]                 get_time("%y%m%d%H%M", timedata, 31)                 format(demoname, 99, "%s%s", timedata, mapname) // No need of ".dem"                 client_cmd(id, "record %s", demoname) // It is one single String         }         return PLUGIN_CONTINUE }

dzverg 10-20-2006 08:49

Re: Auto record demo.
 
BIG thanks!!

jim_yang 10-20-2006 08:58

Re: Auto record demo.
 
"record 1"
record "1"
my bad..
ps: i just realize it right after i posted it and waiting for your correcting:oops:


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

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