Merge pull request #198 from bbassie/feature/cmd-last-command

Feature/cmd last command
This commit is contained in:
Cooldude2606
2021-03-30 04:09:42 +01:00
committed by GitHub
4 changed files with 25 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
--[[-- 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 the last location of a player')
:add_alias('location')
:add_param('player', false, 'player')
: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)