mirror of
https://github.com/etlegacy/etlegacy-lua-scripts.git
synced 2024-11-22 20:41:12 +00:00
32 lines
773 B
Lua
32 lines
773 B
Lua
--[[
|
|
Author: Kewin Polok [Sheldar]
|
|
Contributors:
|
|
License: MIT
|
|
|
|
Description: Script for killing spree sounds
|
|
]]--
|
|
|
|
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
|
|
|
|
|