diff options
Diffstat (limited to 'builtin/game')
-rw-r--r-- | builtin/game/misc.lua | 10 |
1 files changed, 10 insertions, 0 deletions
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() |