2021-01-18 13:34:00 -05:00
|
|
|
-----------------------------------
|
2016-07-29 08:35:15 -06:00
|
|
|
-- func: release
|
2016-01-16 01:26:33 -05:00
|
|
|
-- desc: Releases the player from current events.
|
2021-01-18 13:34:00 -05:00
|
|
|
-----------------------------------
|
2024-08-25 10:54:45 -04:00
|
|
|
---@type TCommand
|
2023-09-02 07:01:35 -04:00
|
|
|
local commandObj = {}
|
2016-01-16 01:26:33 -05:00
|
|
|
|
2023-09-02 07:01:35 -04:00
|
|
|
commandObj.cmdprops =
|
2016-01-16 01:26:33 -05:00
|
|
|
{
|
|
|
|
|
permission = 1,
|
2023-08-28 21:02:28 -04:00
|
|
|
parameters = 's'
|
2018-11-26 20:58:06 -05:00
|
|
|
}
|
2016-01-16 01:26:33 -05:00
|
|
|
|
2023-09-02 07:01:35 -04:00
|
|
|
local function error(player, msg)
|
2023-12-09 23:54:00 +00:00
|
|
|
player:printToPlayer(msg)
|
|
|
|
|
player:printToPlayer('!release (name)')
|
2018-11-26 20:58:06 -05:00
|
|
|
end
|
|
|
|
|
|
2023-09-02 07:01:35 -04:00
|
|
|
commandObj.onTrigger = function(player, name)
|
2018-11-26 20:58:06 -05:00
|
|
|
local target
|
|
|
|
|
if name == nil then
|
|
|
|
|
target = player
|
|
|
|
|
else
|
2021-01-09 08:01:35 +02:00
|
|
|
target = GetPlayerByName(name)
|
2018-11-26 20:58:06 -05:00
|
|
|
if target == nil then
|
2023-08-28 21:02:28 -04:00
|
|
|
error(player, string.format('Player named "%s" not found!', name))
|
2018-11-26 20:58:06 -05:00
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
target:release()
|
|
|
|
|
end
|
2023-09-02 07:01:35 -04:00
|
|
|
|
|
|
|
|
return commandObj
|