05.07.2014, 09:31
I've never done this before; I was actually trying to make a ConsoleMessage() function that allows me to send parameters to it and then display it on the console by using print().
Like in the following example:
How would I do that?
I tried the following but it just didn't work, I'm actually having a hard time trying to figure out what to do here:
Thanks in advance.
Like in the following example:
pawn Код:
ConsoleMessage("It's %d A.M.", 12);
I tried the following but it just didn't work, I'm actually having a hard time trying to figure out what to do here:
pawn Код:
ConsoleMessage(message[], const format[], ...) {
new string[256];
strformat(string, sizeof(string), false, "%s", message); //This is plain wrong, it won't format the string with the extra params. "..."
//This is where I'm getting lost, I don't know what to do in this function
print(string); //This will just display "It's %d A.M." and not "It's 12 A.M."
}