mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-31 04:51:40 +09:00
Fixed clear-inv
This commit is contained in:
@@ -44,11 +44,11 @@ end)
|
|||||||
Commands.add_parse('player-role-online',function(input, player, reject)
|
Commands.add_parse('player-role-online',function(input, player, reject)
|
||||||
local input_player = Commands.parse('player-role',input, player, reject)
|
local input_player = Commands.parse('player-role',input, player, reject)
|
||||||
if not input_player then return end -- nil check
|
if not input_player then return end -- nil check
|
||||||
return Commands.parse('player-online',input_player, player, reject)
|
return Commands.parse('player-online',input_player.name, player, reject)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Commands.add_parse('player-role-alive',function(input, player, reject)
|
Commands.add_parse('player-role-alive',function(input, player, reject)
|
||||||
local input_player = Commands.parse('player-role',input, player, reject)
|
local input_player = Commands.parse('player-role',input, player, reject)
|
||||||
if not input_player then return end -- nil check
|
if not input_player then return end -- nil check
|
||||||
return Commands.parse('player-alive',input_player, player, reject)
|
return Commands.parse('player-alive',input_player.name, player, reject)
|
||||||
end)
|
end)
|
||||||
@@ -11,10 +11,13 @@ require 'config.expcore.command_role_parse'
|
|||||||
-- @command clear-inventory
|
-- @command clear-inventory
|
||||||
-- @tparam LuaPlayer player the player to clear the inventory of
|
-- @tparam LuaPlayer player the player to clear the inventory of
|
||||||
Commands.new_command('clear-inventory', 'Clears a players inventory')
|
Commands.new_command('clear-inventory', 'Clears a players inventory')
|
||||||
:add_param('player', false, 'player-role-alive')
|
:add_param('player', false, 'player-role')
|
||||||
:add_alias('clear-inv', 'move-inventory', 'move-inv')
|
:add_alias('clear-inv', 'move-inventory', 'move-inv')
|
||||||
:register(function(_, player)
|
:register(function(_, player)
|
||||||
local inv = player.get_main_inventory()
|
local inv = player.get_main_inventory()
|
||||||
|
if not inv then
|
||||||
|
return Commands.error{'expcore-commands.reject-player-alive'}
|
||||||
|
end
|
||||||
move_items(inv.get_contents())
|
move_items(inv.get_contents())
|
||||||
inv.clear()
|
inv.clear()
|
||||||
end)
|
end)
|
||||||
Reference in New Issue
Block a user