mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-26 06:01:31 +00:00
We actually have an event for team changes now, so move spree handling out of commands.lua
This commit is contained in:
parent
7f5a18b779
commit
0fffcca1c2
2 changed files with 7 additions and 4 deletions
|
@ -219,10 +219,6 @@ function commands.onclientcommand(clientId, cmdText)
|
|||
|
||||
return 1
|
||||
end
|
||||
|
||||
stats.set(clientId, "currentKillSpree", 0)
|
||||
stats.set(clientId, "currentDeathSpree", 0)
|
||||
stats.set(clientId, "currentReviveSpree", 0)
|
||||
elseif wolfCmd == "callvote" then
|
||||
local voteArguments = {}
|
||||
for i = 2, et.trap_Argc() - 1 do
|
||||
|
|
|
@ -110,8 +110,15 @@ function sprees.onconnect(clientId, firstTime, isBot)
|
|||
end
|
||||
events.handle("onClientConnect", sprees.onconnect)
|
||||
|
||||
function sprees.onteamchange(clientId, old, new)
|
||||
stats.set(clientId, "currentKillSpree", 0)
|
||||
stats.set(clientId, "currentDeathSpree", 0)
|
||||
stats.set(clientId, "currentReviveSpree", 0)
|
||||
end
|
||||
|
||||
function sprees.ongamestatechange(gameState)
|
||||
if gameState == constants.GAME_STATE_RUNNING then
|
||||
events.handle("onClientTeamChange", sprees.onteamchange)
|
||||
events.handle("onPlayerDeath", sprees.ondeath)
|
||||
events.handle("onPlayerRevive", sprees.onrevive)
|
||||
elseif gameState == constants.GAME_STATE_INTERMISSION then
|
||||
|
|
Loading…
Reference in a new issue