1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-03-03 14:53:01 +02:00

implemented adminchat #200

This commit is contained in:
Valansch 2018-08-09 00:14:59 +02:00
parent ef11d6fd05
commit a9a755826f

View File

@ -622,6 +622,20 @@ if not _DEBUG then
end end
end end
local function admin_chat(cmd)
if not game.player or game.player.admin then --admins AND server
for _,p in pairs(game.players) do
if p.admin then
local tag = ''
if game.player.tag and game.player.tag ~= '' then
tag = ' ' .. game.player.tag
end
p.print(string.format("(Admin) %s%s: %s", game.player.name, tag, cmd.parameter), game.player.chat_color)
end
end
end
end
commands.add_command('kill', 'Will kill you.', kill) commands.add_command('kill', 'Will kill you.', kill)
commands.add_command('tpplayer', '<player> - Teleports you to the player. (Admins only)', teleport_player) commands.add_command('tpplayer', '<player> - Teleports you to the player. (Admins only)', teleport_player)
commands.add_command('invoke', '<player> - Teleports the player to you. (Admins only)', invoke) commands.add_command('invoke', '<player> - Teleports the player to you. (Admins only)', invoke)
@ -680,3 +694,4 @@ commands.add_command(
'<player> restores ability for a player to perform actions. (Admins only)', '<player> restores ability for a player to perform actions. (Admins only)',
unjail_player unjail_player
) )
commands.add_command('a', 'Admin chat. Messages all other admins (Admins only)', admin_chat)