Raised This Month: $ Target: $400
 0% 

Plugin that runs "say thetime" when started recording a demo from console


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XerX
New Member
Join Date: Oct 2007
Old 08-03-2009 , 12:31   Plugin that runs "say thetime" when started recording a demo from console
Reply With Quote #1

I tried to make a plugin which displays the current time(using "say thetime") when I type "record" in the console. I already tried in 2 different ways but it doesn't work. Here's what I tried and please correct where necessary or propose a new solution. Thank you in advance.

Code 1:
Quote:
#include <amxmodx>
#include <amxmisc>


#define PLUGIN_NAME "record and thetime"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "darkspeed"

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_concmd("record", "record_time", ADMIN_ALL, "record thetime")
}

public
record_time(id)
{
client_cmd(id, "say thetime");
}
Code 2:
Quote:
#include <amxmodx>
#include <amxmisc>


#define PLUGIN_NAME "record and thetime"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "darkspeed"

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_clcmd("record", "record_time", ADMIN_ALL, "record thetime")
}

public
record_time(id)
{
client_cmd(id, "say thetime");
}
XerX is offline
Old 08-03-2009, 13:55
biscuit628
This message has been deleted by biscuit628.
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 08-03-2009 , 15:12   Re: Plugin that runs "say thetime" when started recording a demo from console
Reply With Quote #2

Try something like this

PHP Code:
#include <amxmodx>
#include <amxmisc>


#define PLUGIN_NAME "record and thetime"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "darkspeed"

public plugin_init()
{
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
register_concmd("amx_record""record_time"ADMIN_ALL"record thetime")
register_concmd("amx_stoprecord""stop_record"ADMIN_ALL"stops rec+thetime")
}

public 
record_time(id)
{
client_cmd(id"record");
client_cmd(id"wait;wait;say thetime");
}

public 
stop_record(id)
{
client_cmd(id"stop");

__________________

Jack86 is offline
XerX
New Member
Join Date: Oct 2007
Old 08-03-2009 , 16:37   Re: Plugin that runs "say thetime" when started recording a demo from console
Reply With Quote #3

It didn't work right. I think I realized where the problem is but cannot fix it myself. Here's my thought: amx_record runs the command record, however it is nameless and therefore it doesn't create a .dem file, runs say thetime only. Somehow amx_record "name" must be converted to record "name"

Last edited by XerX; 08-03-2009 at 16:39.
XerX is offline
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 08-03-2009 , 17:09   Re: Plugin that runs "say thetime" when started recording a demo from console
Reply With Quote #4

Try like this:

PHP Code:
public record_time(idlevelcid)
{
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;

    new 
target[32], name[32];
    
read_argv(1target31);    
    new 
idtarget cmd_target(idtarget8);
    
get_user_name(idtargetname,31)
    
client_cmd(id"record %s"name);
    
client_cmd(id"wait;wait;say thetime");

__________________

Jack86 is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 08-03-2009 , 17:23   Re: Plugin that runs "say thetime" when started recording a demo from console
Reply With Quote #5

Do you want to record another player, or yourself?
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
XerX
New Member
Join Date: Oct 2007
Old 08-04-2009 , 07:00   Re: Plugin that runs "say thetime" when started recording a demo from console
Reply With Quote #6

Eventually, @hateYou from the official Bulgarian amxx site (amxmodxbg.org) helped out and it worked. Here's his suggestion:
Quote:
#include <amxmodx>

public plugin_init()
{
register_plugin("Hook recording", "1.0", "hateYou")
register_clcmd("fullupdate", "record")
}

public
record(id)
{
client_cmd(id, "say thetime")
return
PLUGIN_CONTINUE

}
I thank you all.

Last edited by XerX; 08-04-2009 at 07:03.
XerX is offline
Reply



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 18:28.


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