From 413be76c63309266d3d271f01cc74385067d7263 Mon Sep 17 00:00:00 2001 From: Corey Powell Date: Fri, 26 Nov 2021 14:19:40 -0500 Subject: Implemented disconnect_player (#10492) Co-authored-by: rubenwardy --- builtin/game/misc.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'builtin') diff --git a/builtin/game/misc.lua b/builtin/game/misc.lua index 05237662c..ef826eda7 100644 --- a/builtin/game/misc.lua +++ b/builtin/game/misc.lua @@ -6,6 +6,16 @@ local S = core.get_translator("__builtin") -- Misc. API functions -- +-- @spec core.kick_player(String, String) :: Boolean +function core.kick_player(player_name, reason) + if type(reason) == "string" then + reason = "Kicked: " .. reason + else + reason = "Kicked." + end + return core.disconnect_player(player_name, reason) +end + function core.check_player_privs(name, ...) if core.is_player(name) then name = name:get_player_name() -- cgit v1.2.3