-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathchatcommands.lua
32 lines (26 loc) · 950 Bytes
/
chatcommands.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
local S = postool.S
postool.chatcommand = {
params = '[ resetHUD | stats | toggleChunk ]',
description = 'Configure postool HUD\n'
.. 'Commands are case insensitive. '
.. 'resetHUD: resets to factory settings. '
.. 'stats: ouptuts some information. '
.. 'toggleChunk: toggles chunk indicator for player.',
func = function(sName, sParam)
local oPlayer = minetest.get_player_by_name(sName)
if not oPlayer then
return false, S('Player not found')
end
if 'resethud' == string.lower(sParam) then
postool.resetHud(oPlayer)
return true, S('Postool settings reset to factory settings.')
elseif 'stats' == string.lower(sParam) then
return true, postool.statsString(oPlayer)
elseif 'togglechunk' == string.lower(sParam) then
local bState = postool.toggleChunkMarker(oPlayer)
return true, S('Chunk Marker ') .. (bState and S('ON') or S('OFF'))
else
return postool.showConfigFormspec(oPlayer)
end
end
}