Aligned (team) damage in !stats

This commit is contained in:
Timo Smit 2017-01-30 11:25:09 +01:00
parent dc066b7fba
commit 074999037a

View file

@ -98,17 +98,17 @@ function commandShowStats(clientId, command, victim)
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dHealth: ^2"..(stats["health"] < 0 and "dead" or stats["health"]).."\";")
end
if et.trap_Cvar_Get("fs_game") == "legacy" then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dDamage given: ^2"..string.format("%-8s", stats["damage"]).." ^dTeam damage given: ^2"..stats["teamdamage"].." ^9("..string.format("%0.2f", (stats["teamdamage"] / (stats["totaldamage"] or 1) * 100)).." percent)\";")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dDamage recvd: ^2"..string.format("%-8s", stats["damagereceived"]).." ^dTeam damage recvd: ^2"..stats["teamdamagereceived"].." ^9("..string.format("%0.2f", (stats["teamdamagereceived"] / (stats["totaldamagereceived"] or 1) * 100)).." percent)\";")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dDmg gvn: ^2"..string.format("%-8s", stats["damage"]).." ^dTeam dmg gvn: ^2"..string.format("%-4s", stats["teamdamage"]).." ^9("..string.format("%0.2f", (stats["teamdamage"] / (stats["totaldamage"] or 1) * 100)).." percent)\";")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dDmg rcvd: ^2"..string.format("%-8s", stats["damagereceived"]).." ^dTeam dmg rcvd: ^2"..string.format("%-4s", stats["teamdamagereceived"]).." ^9("..string.format("%0.2f", (stats["teamdamagereceived"] / (stats["totaldamagereceived"] or 1) * 100)).." percent)\";")
else
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dDamage: ^2"..string.format("%-8s", stats["damage"]).." ^dTeam damage: ^2"..stats["teamdamage"].." ^9("..string.format("%0.2f", (stats["teamdamage"] / (stats["totaldamage"] or 1) * 100)).." percent)\";")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dDamage: ^2"..string.format("%-8s", stats["damage"]).." ^dTeam damage: ^2"..string.format("%-4s", stats["teamdamage"]).." ^9("..string.format("%0.2f", (stats["teamdamage"] / (stats["totaldamage"] or 1) * 100)).." percent)\";")
end
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dKills: ^2"..string.format("%-8s", stats["kills"]).." ^dTeam kills: ^2"..stats["teamkills"].." ^9("..string.format("%0.2f", (stats["teamkills"] / (stats["totalkills"] or 1) * 100)).." percent)\";")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dKills: ^2"..string.format("%-8s", stats["kills"]).." ^dTeam kills: ^2"..string.format("%-4s", stats["teamkills"]).." ^9("..string.format("%0.2f", (stats["teamkills"] / (stats["totalkills"] or 1) * 100)).." percent)\";")
if et.trap_Cvar_Get("fs_game") == "legacy" then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dDeaths: ^2"..string.format("%-8s", stats["deaths"]).." ^dSelf kills: ^2"..stats["selfkills"].." ^9("..string.format("%0.2f", (stats["selfkills"] / (stats["totaldeaths"] or 1) * 100)).." percent)\";")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dGibs: ^2"..string.format("%-8s", stats["gibs"]).." ^dTeam gibs: ^2"..stats["teamgibs"].." ^9("..string.format("%0.2f", (stats["teamgibs"] / (stats["totalgibs"] or 1) * 100)).." percent)\";")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dDeaths: ^2"..string.format("%-8s", stats["deaths"]).." ^dSelf kills: ^2"..string.format("%-4s", stats["selfkills"]).." ^9("..string.format("%0.2f", (stats["selfkills"] / (stats["totaldeaths"] or 1) * 100)).." percent)\";")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dGibs: ^2"..string.format("%-8s", stats["gibs"]).." ^dTeam gibs: ^2"..string.format("%-4s", stats["teamgibs"]).." ^9("..string.format("%0.2f", (stats["teamgibs"] / (stats["totalgibs"] or 1) * 100)).." percent)\";")
else
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dDeaths: ^2"..string.format("%-8s", stats["deaths"]).." ^dSuicides: ^2"..stats["suicides"].."\";")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dDeaths: ^2"..string.format("%-8s", stats["deaths"]).." ^dSuicides: ^2"..string.format("%-8s", stats["suicides"]).."\";")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dK/D: ^2"..string.format("%0.2f", (stats["kills"] / ((stats["deaths"] > 0) and stats["deaths"] or 1))).."\";")
end