Skip to content

Commit

Permalink
Merge pull request #217 from cuberite/hardcore
Browse files Browse the repository at this point in the history
Kick players in hardcore mode
  • Loading branch information
bearbin authored Mar 21, 2020
2 parents d0ea249 + 5ce272a commit 70c4de6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 24 deletions.
13 changes: 13 additions & 0 deletions hardcore.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- Implements the OnKilling hook handler that effectively implements the hardcore mode of the server

-- If the server is in hardcore mode, bans the killed player
function OnKilling(Victim, Killer)
if (Victim:IsPlayer()) then
if (cRoot:Get():GetServer():IsHardcore()) then
local Reason = "Killed in hardcore mode"

AddPlayerToBanlist(Victim:GetName(), Reason, "Server-Core")
KickPlayer(Victim:GetName(), Reason)
end
end
end
24 changes: 0 additions & 24 deletions onkilling.lua

This file was deleted.

0 comments on commit 70c4de6

Please sign in to comment.