mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-12-02 00:43:35 +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
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
stats.set(clientId, "currentKillSpree", 0)
|
|
||||||
stats.set(clientId, "currentDeathSpree", 0)
|
|
||||||
stats.set(clientId, "currentReviveSpree", 0)
|
|
||||||
elseif wolfCmd == "callvote" then
|
elseif wolfCmd == "callvote" then
|
||||||
local voteArguments = {}
|
local voteArguments = {}
|
||||||
for i = 2, et.trap_Argc() - 1 do
|
for i = 2, et.trap_Argc() - 1 do
|
||||||
|
|
|
@ -110,8 +110,15 @@ function sprees.onconnect(clientId, firstTime, isBot)
|
||||||
end
|
end
|
||||||
events.handle("onClientConnect", sprees.onconnect)
|
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)
|
function sprees.ongamestatechange(gameState)
|
||||||
if gameState == constants.GAME_STATE_RUNNING then
|
if gameState == constants.GAME_STATE_RUNNING then
|
||||||
|
events.handle("onClientTeamChange", sprees.onteamchange)
|
||||||
events.handle("onPlayerDeath", sprees.ondeath)
|
events.handle("onPlayerDeath", sprees.ondeath)
|
||||||
events.handle("onPlayerRevive", sprees.onrevive)
|
events.handle("onPlayerRevive", sprees.onrevive)
|
||||||
elseif gameState == constants.GAME_STATE_INTERMISSION then
|
elseif gameState == constants.GAME_STATE_INTERMISSION then
|
||||||
|
|
Loading…
Reference in a new issue