Regardless of messages, reset sprees accordingly

This commit is contained in:
Timo Smit 2017-03-13 10:09:19 +01:00
parent 2442f49408
commit 8e181447b2
1 changed files with 4 additions and 4 deletions

View File

@ -247,8 +247,8 @@ end
function sprees.onPlayerSpreeEnd(clientId, causeId, type)
local settingSpreeMessages = settings.get("g_spreeMessages")
if type == sprees.RECORD_DEATH and settingSpreeMessages ~= 0 and bits.hasbit(settingSpreeMessages, 2^type) then
if playerSprees[clientId][sprees.RECORD_DEATH] > spreeMessagesByType[sprees.RECORD_DEATH][1]["amount"] then
if type == sprees.RECORD_DEATH then
if settingSpreeMessages ~= 0 and bits.hasbit(settingSpreeMessages, 2^type) and playerSprees[clientId][sprees.RECORD_DEATH] > spreeMessagesByType[sprees.RECORD_DEATH][1]["amount"] then
local msg = string.format("^7%s^d was the first victim of ^7%s ^dafter ^3%d ^d%ss!",
players.getName(causeId),
players.getName(clientId),
@ -292,11 +292,11 @@ function sprees.onPlayerSpreeEnd(clientId, causeId, type)
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \""..msg.."\";")
end
end
playerSprees[clientId][i] = 0
end
end
end
end
function sprees.onPlayerDeath(victimId, killerId, mod)