mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-22 04:12:19 +00:00
Fixed !stats command on legacymod (refs #46)
This commit is contained in:
parent
3231ea6c74
commit
04c78f0886
1 changed files with 25 additions and 15 deletions
|
@ -16,9 +16,11 @@
|
|||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
local auth = require (wolfa_getLuaPath()..".auth.auth")
|
||||
local util = require (wolfa_getLuaPath()..".util.util")
|
||||
|
||||
local commands = require (wolfa_getLuaPath()..".commands.commands")
|
||||
|
||||
local util = require (wolfa_getLuaPath()..".util.util")
|
||||
|
||||
function commandShowStats(clientId, cmdArguments)
|
||||
if cmdArguments[1] == nil then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dstats usage: "..commands.getadmin("stats")["syntax"].."\";")
|
||||
|
@ -53,13 +55,21 @@ function commandShowStats(clientId, cmdArguments)
|
|||
["totalkills"] = et.gentity_get(cmdClient, "sess.kills") + et.gentity_get(cmdClient, "sess.team_kills"),
|
||||
["damage"] = et.gentity_get(cmdClient, "sess.damage_given"),
|
||||
["damagereceived"] = et.gentity_get(cmdClient, "sess.damage_received"),
|
||||
["teamdamage"] = et.gentity_get(cmdClient, "sess.team_damage"),
|
||||
-- ["teamdamagereceived"] = et.gentity_get(cmdClient, "sess.team_received"), -- ETPro only
|
||||
["totaldamage"] = et.gentity_get(cmdClient, "sess.damage_given") + et.gentity_get(cmdClient, "sess.team_damage"),
|
||||
["deaths"] = et.gentity_get(cmdClient, "sess.deaths"),
|
||||
["suicides"] = et.gentity_get(cmdClient, "sess.suicides")
|
||||
["deaths"] = et.gentity_get(cmdClient, "sess.deaths")
|
||||
}
|
||||
|
||||
if et.trap_Cvar_Get("fs_game") == "legacy" then
|
||||
stats["teamdamage"] = et.gentity_get(cmdClient, "sess.team_damage_given")
|
||||
stats["totaldamage"] = et.gentity_get(cmdClient, "sess.damage_given") + et.gentity_get(cmdClient, "sess.team_damage_given")
|
||||
stats["suicides"] = et.gentity_get(cmdClient, "sess.self_kills")
|
||||
elseif settings.get("fs_game") == "etpro" then
|
||||
stats["teamdamagereceived"] = et.gentity_get(cmdClient, "sess.team_received") -- ETPro only
|
||||
else
|
||||
stats["teamdamage"] = et.gentity_get(cmdClient, "sess.team_damage")
|
||||
stats["totaldamage"] = et.gentity_get(cmdClient, "sess.damage_given") + et.gentity_get(cmdClient, "sess.team_damage")
|
||||
stats["suicides"] = et.gentity_get(cmdClient, "sess.suicides")
|
||||
end
|
||||
|
||||
if stats["totalkills"] == 0 then stats["totalkills"] = 1 end
|
||||
if stats["totaldamage"] == 0 then stats["totaldamage"] = 1 end
|
||||
|
||||
|
|
Loading…
Reference in a new issue