forked from cuberite/Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmd_kill.lua
More file actions
26 lines (22 loc) · 718 Bytes
/
cmd_kill.lua
File metadata and controls
26 lines (22 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function HandleKillCommand(Split, Player)
local Response
local KillPlayer = function(OtherPlayer)
OtherPlayer:TakeDamage(dtPlugin, nil, 1000, 1000, 0)
if Split[2] then
Response = SendMessageSuccess(Player, "Successfully killed player \"" .. OtherPlayer:GetName() .. "\"")
end
end
if not Split[2] then
if not Player then
Response = SendMessage(nil, "Usage: " .. Split[1] .. " <player>")
else
KillPlayer(Player)
end
elseif Split[2] == "" or not cRoot:Get():FindAndDoWithPlayer(Split[2], KillPlayer) then
Response = SendMessageFailure(Player, "Player \"" .. Split[2] .. "\" not found")
end
return true, Response
end
function HandleConsoleKill(Split)
return HandleKillCommand(Split)
end