Raised This Month: $ Target: $400
 0% 

Cant seem to get register_logevent working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EKS
Veteran Member
Join Date: Mar 2004
Location: Norway
Old 09-02-2004 , 04:10   Cant seem to get register_logevent working
Reply With Quote #1

Code:
public plugin_init() {     register_plugin("CVAR  change","1.0.0","EKS")       register_logevent("cvar_changed",0,"mp_timelimit") } public cvar_changed() {     new Arg[14]     read_logargv(0,Arg,13)     server_cmd("echo cvar_changed function called")     if(equal(Arg,"mp_timelimit"))     {         server_cmd("echo mp_timelimit changed")         remove_task(1+32)         new Float:TaskTime = float(get_timeleft()) - 10.0         set_task(TaskTime,"task_ShowStats",1+32);     } }

From the include it looks like it should work:
Quote:
/* Registers log event on which the given function will be called
* Examples for conditions:
* "0=World triggered" "1=Game_Commencing"
* "1=say"
* "3=Terrorists_Win"
* "1=entered the game"
* "0=Server cvar"
*/
native register_logevent(const function[], argsnum, ... );
Well, i cant seem to get it working. If someone can point out the error to be id be greatfull
EKS is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-02-2004 , 04:39  
Reply With Quote #2

Code:
register_logevent("cvar_changed",0)
Freecode is offline
EKS
Veteran Member
Join Date: Mar 2004
Location: Norway
Old 09-02-2004 , 05:05  
Reply With Quote #3

I have tried that to. Cant seem to make that work either[/code]
EKS is offline
Ingram
Veteran Member
Join Date: May 2004
Old 09-02-2004 , 14:23  
Reply With Quote #4

take a look at runemod there is a logevent there
Ingram is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 09-02-2004 , 15:18  
Reply With Quote #5

Try:
Code:
register_logevent("cvar_changed",4,"1=Server cvar", "2=mp_timelimit")
__________________
hello, i am pm
PM is offline
EKS
Veteran Member
Join Date: Mar 2004
Location: Norway
Old 09-02-2004 , 17:21  
Reply With Quote #6

Quote:
Originally Posted by JJkiller
take a look at runemod there is a logevent there
It uses it to catch the round start.

Quote:
Originally Posted by PM
Try:
Code:
register_logevent("cvar_changed",4,"1=Server cvar", "2=mp_timelimit")
Does not seem to work either. I just dunno
EKS is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 09-03-2004 , 07:00  
Reply With Quote #7

Hehe ok, I assume you want to catch the event
Server cvar "mp_timelimit" = "xx"
Anyway, register_logevent works like this (if I remember correctly):
register_logevent("Func to be called", number of total arguments of the event, argument specifications).
AFAIK, every " char indicates a new argument. That would mean that argument 0 is "Server cvar" and argument 1 is "mp_timelimit".
You might want to try this:
Code:
register_logevent("cvar_changed",4,"0=Server cvar", "1=mp_timelimit")
I will test it as soon as I will have access to a running Half Life install.
__________________
hello, i am pm
PM is offline
EKS
Veteran Member
Join Date: Mar 2004
Location: Norway
Old 09-04-2004 , 10:44  
Reply With Quote #8

hmm, that dident work either. I just dont understand why.
EKS 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 17:13.


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