mirror of
https://github.com/etlegacy/etlegacy-lua-scripts.git
synced 2024-11-10 15:31:47 +00:00
Detecting deaths not related to killing spree
This commit is contained in:
parent
d3911b9964
commit
a4ec562ab9
1 changed files with 28 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue