1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-17 20:58:13 +02:00

Update jail.lua

Fixed so plebs who aren't admin does not trigger an embed message.
This commit is contained in:
Gerkiz 2020-01-29 22:40:26 +01:00 committed by GitHub
parent cfd737dace
commit 83e74b654e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -135,20 +135,21 @@ local function on_console_command(event)
local player = game.players[event.player_index]
local reason = event.parameters
if not reason then return end
if not player.admin then return end
if cmd == 'ban' then
if player then
Server.to_banned_embed(table.concat{'[BANNED] ' .. player.name .. ' banned ' .. reason})
Server.to_banned_embed(table.concat{player.name .. ' banned ' .. reason})
return
else
Server.to_banned_embed(table.concat{'[BANNED] Server banned ' .. reason})
Server.to_banned_embed(table.concat{'Server banned ' .. reason})
return
end
elseif cmd == 'unban' then
if player then
Server.to_banned_embed(table.concat{'[UNBANNED] ' .. player.name .. ' unbanned ' .. reason})
Server.to_banned_embed(table.concat{player.name .. ' unbanned ' .. reason})
return
else
Server.to_banned_embed(table.concat{'[UNBANNED] Server unbanned ' .. reason})
Server.to_banned_embed(table.concat{'Server unbanned ' .. reason})
return
end
end