mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Basic implentation of a last location command
This commit is contained in:
@@ -28,6 +28,7 @@ return {
|
||||
'modules.commands.find',
|
||||
'modules.commands.home',
|
||||
'modules.commands.connect',
|
||||
'modules.commands.last-location',
|
||||
|
||||
--- Addons
|
||||
'modules.addons.chat-popups',
|
||||
|
||||
@@ -174,6 +174,7 @@ Roles.new_role('Veteran','Vet')
|
||||
:set_parent('Member')
|
||||
:allow{
|
||||
'command/chat-bot',
|
||||
'command/last-location'
|
||||
}
|
||||
:set_auto_assign_condition(function(player)
|
||||
if player.online_time >= hours10 then
|
||||
|
||||
@@ -79,4 +79,7 @@ too-many-matching=Multiple server were found with the given name: __1__
|
||||
wrong-version=Servers were found but are on a different version: __1__
|
||||
same-server=You are already connected to the server: __1__
|
||||
offline=You cannot connect as the server is currently offline: __1__
|
||||
none-matching=No servers were found with that name, if you used an address please append true to the end of your command.
|
||||
none-matching=No servers were found with that name, if you used an address please append true to the end of your command.
|
||||
|
||||
[expcom-lastlocation]
|
||||
response=Last location of __1__ is [gps=__2__,__3__]
|
||||
19
modules/commands/last-location.lua
Normal file
19
modules/commands/last-location.lua
Normal 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 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)
|
||||
Reference in New Issue
Block a user