Thread: Message Logging
View Single Post
sawce
The null pointer exception error and virtual machine bug
Join Date: Oct 2004
Old 10-04-2006 , 02:05   Re: Message Logging
Reply With Quote #23

A string as an argument containing a valid format parameter (eg: "%s") will cause it to throw an error.

Changing log_msgf to:
Code:
/* Writes messages to log file depending on value of amx_ml_logmode */ log_msgf(const fmt[], {Float,Sql,Result,_}:...) {           static buffer[512]     vformat(buffer, 511, fmt, 2)         replace(buffer,511,"%","%%") // stop %s from messing it up         if (get_pcvar_num(g_cvarLogMode))         log_to_file(LOGFILE_NAME, buffer)     else         log_amx(buffer) }

fixes it

ps: hi ds
sawce is offline