mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-30 04:30:58 +02:00
added command logging
This commit is contained in:
parent
aea7bc2d0f
commit
9630cc4d1b
19
control.lua
19
control.lua
@ -159,6 +159,23 @@ Event.add(
|
||||
|
||||
local gui = player.gui
|
||||
gui.top.style = 'slot_table_spacing_horizontal_flow'
|
||||
gui.left.style = 'slot_table_spacing_vertical_flow'
|
||||
gui.left.style = 'slot_table_spacing_vertical_flow'
|
||||
end
|
||||
)
|
||||
|
||||
Event.add(
|
||||
defines.events.on_console_command,
|
||||
function(event)
|
||||
local command = event.command
|
||||
if command == 'c' or command == 'command' or command == 'silent-command' or command == 'hax' then
|
||||
local player = game.players[event.player_index]
|
||||
if player then
|
||||
player = player.name
|
||||
else
|
||||
player = '<server>'
|
||||
end
|
||||
local s = table.concat {'[Command] ', player, ' /', command, ' ', event.parameters}
|
||||
log(s)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user