[LOGS] SaveToFile function problem.
#1

Hello guys

Because i want to see the logs at my server's panel, i decided to transfer them to MySQL. Also, to don't have two lines for each log, i have created a function, what looks like this, when i use it to save a log:
pawn Код:
SaveToFile("KickLog", "Player %s has been kicked from server. Reason: Didn't know how to script this function", "Edvin");
First i tried to do it with a stocks, using numargs() and getarg() functions, but didn't work. After, i've tried to make a macro, but this also don't work. Here is the macro:
pawn Код:
#define SaveToFile((%0), (%1), (%2)) \
{\
    new string[2048];\
    format(string, 2048, (%1), %2);\
    format(gString, sizeof(gString), "INSERT INTO `logs` (`log_id`, `log_name`, `log_text`, `datetime`) VALUE(0, '%s', '%s', '%s')", log_name, string, DateTime());\
    mysql_function_query(handle, gString, false, "", "");\
}\
When i compile it shows me that "SaveToFile" function doesn't exists, but it exists. I think it's something wrong with 'da function, but i don't know what.
pawn Код:
E:\Server.pwn(2221): error 017: undefined symbol "SaveToFile"
E:\Server.pwn(2221) : error 017: undefined symbol "SaveToFile"
And they continue...
Thanks in advance xD.
Reply
#2

When you define something, the left part is without spaces. So it would be: SaveToFile(%0,%1,%2)

Anyways, why don't you use it as a stock?
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
When you define something, the left part is without spaces. So it would be: SaveToFile(%0,%1,%2)

Anyways, why don't you use it as a stock?
I didn't know that thing xD, thanks now it works

I've tried like i said, i used arguments functions: numargs(), getarg, but when i looked into the table, any of the param like player name, hasn't been set.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)