Detecting deaths not related to killing spree

This commit is contained in:
sheldar 2018-02-11 14:24:07 +01:00
parent d3911b9964
commit a4ec562ab9

View file

@ -1,9 +1,32 @@
--[[
Author: Kewin Polok [Sheldar]
Contributors:
License: MIT
Author: Kewin Polok [Sheldar]
Contributors:
License: MIT
Description: This script plays killing spree sounds
Description: Script for killing spree sounds
]]--
local version = "0.1"
local modname = "killing-spree"
local version = "0.1"
local WORLDSPAWN_ENTITY = 1022
local ENTITYNUM_NONE = 1023
function et_InitGame()
et.RegisterModname(modname .. " ".. version)
end
function et_Obituary(target, attacker, meansOfDeath)
local targetTeam = et.gentity_get(target, "sess.sessionTeam")
local attackerTeam = et.gentity_get(attacker, "sess.sessionTeam")
local suicide = target == attacker
local teamkill = targetTeam == attackerTeam
local killerIsNotPlayer = killer == WORLDSPAWN_ENTITY or killer == ENTITYNUM_NONE
if suicide or teamkill or killerIsNotPlayer then
return
end
end