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

View file

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