Raised This Month: $12 Target: $400
 3% 

log_to_file to log_amx


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 03-29-2004 , 19:22   log_to_file to log_amx
Reply With Quote #1

Ok, I am kinda confused but how could I convert

Code:
log_to_file(logfilename,"%s has left; %s is no longer nominated",kName,nmaps[n])

into using the AMXX navtive

Code:
native log_amx(const string[], {Float,_}:...);

*EDIT

I think i figured it out just now, suggestions are welcomed tho

*EDIT again

YEa i figured it out, thanks for the help anywayz.
__________________

BigBaller is offline
Hangman5386
Member
Join Date: Mar 2004
Old 03-30-2004 , 07:08  
Reply With Quote #2

Maybe you could explain what you did and how it works. I think you're not the only one who has this problem.
Hangman5386 is offline
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 03-30-2004 , 08:42  
Reply With Quote #3

Ok

Code:
log_to_file(logfilename,"%s has left; %s is no longer nominated",kName,nmaps[n])

That code right there creates a new file name inside of the amxx\logs directory.

Well when posting a plugin on this forum you are not allowed to use this native log_to_file but you have to use the native log_amx

With the native log_amx the logs will be placed into the already generated amxx\log files.

Sooo for example

Code:
log_to_file(logfilename,"%s has left; %s is no longer nominated",kName,nmaps[n])

Well using the log_amx native it would look like

Code:
log_amx("%s has left; %s is no longer nominated",kName,nmaps[n])

Then anything else related to "log_to_file" or "logfilename" would no longer be needed because they would have no more use in the code, so you could safely remove those and change to log_amx and have a smaller code, more productive code.

I hope that helps
__________________

BigBaller is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 03-30-2004 , 09:58  
Reply With Quote #4

Good explanation!! I never used it yet in AMXX but now I know how!! Glad you posted your findings!!
xeroblood is offline
Send a message via MSN to xeroblood
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 03-30-2004 , 11:08  
Reply With Quote #5

Anything to help out man, many people have helped me and if I can help with what little I know I will try
__________________

BigBaller is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-30-2004 , 11:29  
Reply With Quote #6

just a small side note:
in 0.2, when
when amx_logging is 0, all calls to log_amx are ignored. when amx_logging is 1, it is logged into amxx/logs/logfile, when amx_logging is 2, it is logged into HL logs (moddir/logs/logfile)
__________________
hello, i am pm
PM is offline
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 03-30-2004 , 12:05  
Reply With Quote #7

Ok soo PM, will amx_logging be defualted at 1 or something?

Or will it be added in the amxx.cfg something like

// AMX MOD X Logging
// 0 = disabled
// 1 = <mod\addons\amxx\logs directory
// 2 = <mod>\logs directory
amx_logging 1

???

and would we have to change our current plugins for this change, I would think not but just asking?
__________________

BigBaller is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-30-2004 , 12:11  
Reply With Quote #8

yes, default will be 1.

to change the log mode before any logging starts, you need to place the command into (listen)server.cfg; you can also change it when the server runs though

no, plugin changes are not neccessary
__________________
hello, i am pm
PM 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 08:55.


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