Add locale
[minetest_central_message.git] / README.md
blob4ba9752a8517354a39a801565d38383c18ef6331
1 # Central Message
2 ## Overview
3 * Description: Simple API and server command to display short messages at the center of the screen
4 * Author: Wuzzy
5 * License of everything: MIT License
6 * Shortname: `central_message`
7 * Version: 0.3.0 (using Semantic Versioning 2.0.0, see [SemVer](http://semver.org/))
9 ## Longer description
10 This Minetest mod allows other mods to display a short message at the center of the screen.
11 Each message is displayed for a few seconds, then it is removed.
12 When multiple messages are pushed quickly in succession, the messages will be “stacked”
13 on the screen.
15 This mod adds the server command “cmsg” as well as an API for mods to display messages.
16 The syntax is “`/cmsg <player> <text>`”. If `<player>` is “*”, the message is sent to all players.
18 This mod can be useful to inform about all sorts of events and is an alternative to use the chat log
19 to display special events.
21 Some usage examples:
23 * Messages about game events, like victory, defeat, next round starting, etc.
24 * Error message directed to a single player
25 * Informational messages
26 * Administational messages to warn players about a coming server shutdown
27 * Show messages by using a command block from Mesecons
29 ## Settings
30 This mod can be configured via `minetest.conf`.
32 Currently, these settings are recognized:
34 * `central_message_max`: Limit the number of messages displayed at once, by providing a number. Use `0` for no limit. Default: `7`
35 * `central_message_time`: How long (in seconds) a message is shown. Default: `5`
36 * `central_message_color`: Set the message color of all messages. Value must be of format `(R,G,B)`. Default: `(255,255,255)` (white).
39 ## API
40 ### `cmsg.push_message_player(player, message)`
41 Display a new message to one player only.
43 #### Parameters
44 * `player`: An `ObjectRef` to the player to which to send the message
45 * `message`: A `string` containing the message to be displayed to the player
47 #### Return value
48 Always `nil`.
51 ### `cmsg.push_message_all(message)`
52 Display a new message to all connected players.
54 #### Parameters
55 * `player`: An `ObjectRef` to the player to which to send the message
56 * `message`: A `string` containing the message to be displayed to all players
58 #### Return value
59 Always `nil`.