PDebug
Print to the debug terminal
Description
PDebug( const text[], ... )
Print a string to the debug terminal if it is open and active.
Parameters
text | String to print with optional formatting placeholders |
… | Optional parameters |
Formats a text string and outputs it to the debug terminal. If the debug terminal is not open and active, this command has no effect. Messages are not buffered. They will only be sent and printed if the terminal is open.
The text string use formatting similar to the C language 'printf' command.
Up to 20 messages will be sent in a burst. After that, the message rate is limited to one message per second. For example, if 25 messages are generated at once (within 1 second), only the first 20 will be sent. If 5 new messages are produced 10 seconds later, all 5 will be sent.
Each message will output on the debug terminal with a time stamp (minutes, seconds, 1/100's from startup) and the script that produced the message (USR/MOB/SDI etc..).
Return value
Returns 1 if the message was sent to the debug terminal. If no terminal is open, communication is not available or the rate limit is active, the return value is 0.
Example usage
new x = 10; new s{} = "Some Text"; new Float:f = 123.45; PDebug("Hello World %d", x); // Outputs: 08:36.10 USR "Hello World 10" PDebug("A String:%s, A Float:%f", s, f); // Outputs: 08:36.11 USR "A String:Some Text, A Float:123.45000"