__nprintf doesn't output anything on the client in Zandronum 3.0. The BeginPrint and EndPrint work, as evidenced by the bars in the console, but there's nothing in between them.
Same deal with printf logging, and I'm sure the same thing would happen with HUD messages.
Making the script serverside and puking it will get the expected results: "test\nCPLN: -1".
Code: Select all
#include <stdio.h>
#include <string.h>
#include <ACS_Zandronum.h>
[[call("ScriptS"), address("butt"), script("Clientside"), script("Net")]]
void TestScript()
{
// shows print bars
ACS_BeginPrint();
// shows no text
__nprintf("test\n");
__nprintf("CPLN: %d", ACS_ConsolePlayerNumber());
ACS_EndPrint();
// shows nothing
printf("log CPLN: %d\n", ACS_ConsolePlayerNumber());
// crashes
fputc('a', stdout);
fputc('y', stdout);
fputc('y', stdout);
fputc(' ', stdout);
fputc('l', stdout);
fputc('m', stdout);
fputc('a', stdout);
fputc('o', stdout);
fputc('\n', stdout);
}
edit: I tried to use fputc as a workaround for the printf logging. It just straight up crashes clientside. Serverside it works fine.