Files
factorio-scenario-ExpCluster/modules/commands/last-location.lua
2021-02-09 22:21:11 +01:00

19 lines
848 B
Lua

--[[-- Commands Module - Last location
- Adds a command that will return the last location of a player
@commands LastLocation
]]
local Commands = require 'expcore.commands' --- @dep expcore.commands
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
require 'config.expcore.command_general_parse'
--- Get the last location of a player.
-- @command last-location
-- @tparam LuaPlayer player the player that you want a location of
Commands.new_command('last-location', 'Sends you a warning')
:add_param('player', false, 'player-role')
:set_flag('admin_only')
:register(function(player, action_player)
local action_player_name_color = format_chat_player_name(action_player)
player.print{'expcom-lastlocation.response', action_player_name_color, action_player.position.x, action_player.position.y}
end)