mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-12 10:04:40 +02:00
sc command
This commit is contained in:
parent
3883c9e770
commit
a0fee48bc8
@ -498,6 +498,36 @@ if _DEBUG then
|
||||
commands.add_command('all-tech', 'researches all technologies (debug only)', all_tech)
|
||||
end
|
||||
|
||||
commands.add_command(
|
||||
'sc',
|
||||
'silent-command (Admins only)',
|
||||
function(cmd)
|
||||
local player = game.player
|
||||
local p
|
||||
if player then
|
||||
p = player.print
|
||||
if not player.admin then
|
||||
p('Only admins can use this command.')
|
||||
return
|
||||
end
|
||||
else
|
||||
p = print
|
||||
end
|
||||
|
||||
local func, err = loadstring(cmd.parameter)
|
||||
if not func then
|
||||
p(err)
|
||||
return
|
||||
end
|
||||
|
||||
local _, err2 = pcall(func)
|
||||
if err2 then
|
||||
local i = err2:find('\n')
|
||||
p(err2:sub(1, i))
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
--- Enables cheat mode (free pocket crafting) for player
|
||||
commands.add_command(
|
||||
'hax',
|
||||
|
Loading…
Reference in New Issue
Block a user