Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Difference between revisions of "bprint"
From Quake Wiki
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | ''void'' '''bprint'''(''string'' msg) | |
− | |||
− | Broadcasts | + | == Usage == |
− | + | Broadcasts a message to all players in the game. Messages will continue to print on the same line until a '''\n''' character is placed, allowing chaining of calls to print to the same line. | |
− | |||
− | |||
− | |||
+ | This builtin has special functionality in that it can accept an unlimited number of string arguments (with a cap of 255 characters in a string). Multiple versions of the builtin can be assigned to the same index with as many additional string arguments as needed e.g. | ||
+ | void bprint3(string start, string middle, string end) = #23; | ||
+ | This can allow for easily inserting numbers into the middle of the string since normally this would require a chain of multiple calls to do. | ||
+ | bprint3("There are ", ftos(self.count), " switches remaining\n"); | ||
+ | will display as "There are 4 switches remaining" if <code>self.count</code> is 4. | ||
+ | |||
+ | === Parameters === | ||
+ | *''msg'' | ||
+ | :The message to display. | ||
+ | |||
+ | == Example == | ||
+ | // Print an obituary after a player dies | ||
+ | bprint(player.netname); | ||
+ | bprint(" saw an untimely demise\n"); | ||
[[Category:QuakeC Function]] | [[Category:QuakeC Function]] |
Latest revision as of 16:01, 31 July 2023
void bprint(string msg)
Usage[edit]
Broadcasts a message to all players in the game. Messages will continue to print on the same line until a \n character is placed, allowing chaining of calls to print to the same line.
This builtin has special functionality in that it can accept an unlimited number of string arguments (with a cap of 255 characters in a string). Multiple versions of the builtin can be assigned to the same index with as many additional string arguments as needed e.g.
void bprint3(string start, string middle, string end) = #23;
This can allow for easily inserting numbers into the middle of the string since normally this would require a chain of multiple calls to do.
bprint3("There are ", ftos(self.count), " switches remaining\n");
will display as "There are 4 switches remaining" if self.count
is 4.
Parameters[edit]
- msg
- The message to display.
Example[edit]
// Print an obituary after a player dies bprint(player.netname); bprint(" saw an untimely demise\n");