#define problem. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: #define problem. (
/showthread.php?tid=327522)
#define problem. -
ikkentim - 21.03.2012
Hello, I am trying to make a script that logs my textdraws, due to debugging:
Code:
stock TextDrawShowForPlayerF(playerid, Text:text, str[]) //playerid(INT), The textdraw(TEXT), extra logging text(STRING)
{
new deb[128];
format(deb, 128 "TextDrawShowForPlayer(%d, %d){%s}\n", playerid, text, str);
//Shows the playerid, the ID of the text (yes, that works) and I want to let it show the variable's name, for example TextDrawShowForPlayer(0, 104){txtTimeDisplay}
LogF(deb); // My function to log something into a separate file
TextDrawShowForPlayer(playerid, text);//Actually, show it
}
#define TextDrawShowForPlayer(%1,%2) TextDrawShowForPlayerF(%1,%2, "%2")
//Define it so, that the Logging function is called
The thing is, the log file shows this:
TextDrawShowForPlayer(0, 104){%2}
Anyone knows a way to do this?
I already tried :
#define TextDrawShowForPlayer(%1,%2) TextDrawShowForPlayerF(%1,%2, %2)
(without the "" quotes...)
Thank you in advance
Re: #define problem. -
ikkentim - 21.03.2012
Sorry, I am answer hungry and it was already on the 2th page...
edit: yet read the rules, and I seem to broke one here; sorry...