2013-01-28 11:54:11 -05:00
|
|
|
function OnKilling(Victim, Killer)
|
2013-04-20 04:49:41 -04:00
|
|
|
if Victim:IsPlayer() then
|
2013-03-24 11:44:44 -04:00
|
|
|
Server = cRoot:Get():GetServer()
|
|
|
|
if Killer == nil then
|
|
|
|
if Victim:IsOnFire() then
|
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " burned away." )
|
|
|
|
CheckHardcore(Victim)
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
if Victim:GetWorld():GetBlock(Victim:GetPosX(), Victim:GetPosY(), Victim:GetPosZ()) == 10 or Victim:GetWorld():GetBlock(Victim:GetPosX(), Victim:GetPosY(), Victim:GetPosZ()) == 11 then
|
|
|
|
Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " tried to swim in lava" )
|
|
|
|
CheckHardcore(Victim)
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
else
|
2013-04-20 04:49:41 -04:00
|
|
|
if Killer:IsPlayer() then
|
2013-03-24 11:44:44 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " is killed by " .. Killer:GetName() )
|
|
|
|
CheckHardcore(Victim)
|
|
|
|
return false
|
2013-04-20 04:49:41 -04:00
|
|
|
elseif Killer:IsMob() then
|
2013-03-24 11:44:44 -04:00
|
|
|
if Killer:IsA("cZombie") then
|
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " is eaten by a zombie")
|
|
|
|
elseif Killer:IsA("cSkeleton") then
|
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " is killed by a skeleton" )
|
|
|
|
elseif Killer:IsA("cCreeper") then
|
2013-04-20 04:49:41 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " is blown up by a creeper")
|
2013-03-24 11:44:44 -04:00
|
|
|
elseif Killer:IsA("cSpider") then
|
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " is killed by a spider")
|
|
|
|
elseif Killer:IsA("cCaveSpider") then
|
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " is killed by a cavespider")
|
|
|
|
elseif Killer:IsA("cBlaze") then
|
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " is killed by a blaze")
|
|
|
|
elseif Killer:IsA("cEnderman") then
|
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " is slain by a enderman")
|
|
|
|
elseif Killer:IsA("cSilverfish") then
|
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " is killed by a silverfish")
|
|
|
|
elseif Killer:IsA("cSlime") then
|
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " is killed by a slime")
|
|
|
|
elseif Killer:IsA("cWitch") then
|
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " is killed by a witch")
|
|
|
|
elseif Killer:IsA("cZombiepigman") then
|
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " is slain by a zombiepigman")
|
|
|
|
elseif Killer:IsA("cMagmacube") then
|
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " is killed by a magmacube")
|
|
|
|
elseif Killer:IsA("cWolf") then
|
2013-04-20 04:49:41 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "Player " .. Victim:GetName() .. " is killed by a wolf")
|
2013-03-24 11:44:44 -04:00
|
|
|
end
|
2013-04-20 04:49:41 -04:00
|
|
|
CheckHardcore(Victim)
|
|
|
|
return false
|
2013-03-24 11:44:44 -04:00
|
|
|
end
|
2012-01-26 18:10:49 -05:00
|
|
|
end
|
2013-03-24 11:44:44 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. Victim:GetName() .. " Died")
|
2013-04-20 04:49:41 -04:00
|
|
|
CheckHardcore(Victim)
|
2013-03-24 11:44:44 -04:00
|
|
|
end
|
|
|
|
end
|
2012-01-26 18:10:49 -05:00
|
|
|
|
2013-03-24 11:44:44 -04:00
|
|
|
function CheckHardcore(Victim)
|
|
|
|
if HardCore == "true" then
|
|
|
|
if Victim:IsPlayer() == true then
|
|
|
|
local KilledPlayer = tolua.cast(Victim, "cPlayer")
|
|
|
|
BanPlayer(KilledPlayer:GetName(), "You Died")
|
2012-01-26 18:10:49 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|