1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--==== KILLS STATISTICS ====--
function stat_kills(killer,victim)
	if (killer ~= victim) then
		UserManager.incValue(id,"Kills",1)
	end
end
function stat_kills_variable(id)
	return(UserManager.getValue(id,"Kills"))
end
AddValue("Kills")
AddFunction("kill",stat_kills)
AddStats("Kills (total)", "gfx/stats/stat_kills.png",stat_kills_variable)
--==== DEATHS STATISTICS ====--
function stat_deaths(killer,victim)
	UserManager.incValue(victim,"Deaths",1)
end
function stat_deathsVariable(id)
	return(UserManager.getValue(id,"Deaths"))
end
AddValue("Deaths")
AddFunction("die",stat_deaths)
AddStats("Deaths", "gfx/stats/stat_deaths.png",stat_deathsVariable)
--==== KILLS/DEATHS RATIO STATISTICS ====--
function stat_kdratioVariable(id)
	local kills = UserManager.getValue(id,"Kills")
	local deaths = UserManager.getValue(id,"Deaths")
	if (kills == 0) then
		return("0.0")
	end
	local ratio = tonumber(tostring((kills / deaths)):sub(1, 5))
	return(ratio)
end
AddStats("K / D Ratio", "gfx/stats/stat_kd.png",stat_kdratioVariable)