Closed ghost closed 5 years ago
Hello This is not a critical issue, but it made me spend a few hours.
Code:
PLUGIN_EXPORT bool PLUGIN_CALL OnGameModeInit() { std::cout << "GAME MODE INIT"; return true; }
Trouble: The message "GAME MODE INIT" will appear only when the server is turned off But, if I add "endl" or "\n", then the message is output correctly (when this callback is called)
I use:
What could be the problem?
That's just how stdout works, it buffers content until your print a newline or flush it. It's a general C/C++ thing, not related to sampgdk.
You could also use logprintf (or sampgdk::logprintf).
logprintf
sampgdk::logprintf
Hello This is not a critical issue, but it made me spend a few hours.
Code:
Trouble: The message "GAME MODE INIT" will appear only when the server is turned off But, if I add "endl" or "\n", then the message is output correctly (when this callback is called)
I use:
What could be the problem?