Hello
Please is there a way to get the K/D of a player with LUA ?
Have you an example of script ?
Thank you 
Hello
Please is there a way to get the K/D of a player with LUA ?
Have you an example of script ?
Thank you 
Hey guys⌠I add:
set lua_modules "dbstats.lua dbstat.lua
i changed dbinfo in all used lua
i put in console, and rcon⌠all the ways
!sqlcreate
and i see no info about creating db, and !cmds doesnât work.
any ideas?
should i add some [command] ?
Afaik there is no such script. Maybe someone wrote one, but I donât know.
Its not that simple in any case, you need to keep track of a player. And then just count his deaths and kills.
Kmod has those things, but I think it does not calculate k/d ratio.
You can check these 2 places for scripts and infos:
http://wolfwiki.anime.net/index.php/Category:ETPro:Mods
Itâs not that hard, basicly you keep a record of all players using a table of some sorts, with all their kills and deaths.
You can ârecordâ those records by hooking into the EV_OBITUARY event and get the killer and target Ids.
With those Ids you can update the playertableâs kills and deaths.
I donât have a LUA example, but we did something similar with GMSM.
This can be realized easily: Depending on what you want the script to do, you can either (as previously mentioned) use et_Obituary() to count the kills & deaths, or read the client entity fields sess.kills & sess.deaths.
If you need any help with your script, contact me.
cool Thank you for the answers
I have checked many LUA scripts, but I have not find for the moment
What is interesting me is to get the âpermanent k/dâ of the players
I just want to make something that be able to calculate and show the Total of Playerâs K/D on a side.
examples :
Axis side
player 0 : k/d 1000
player 1 : k/d 1152
Total of all K/D AXIS players = 2152
Allies side
player 2 : k/d 2235
player 3 : k/d 1238
Total of all K/D ALLIES players = 3473
More the script is simple, less it eat some resourcesâŚ
I do not want to track too much players because on some low powered servers it make server bad frags
Prefer something that can be punctually called by a command
The difficulty come from the fact I need to understand how to get the K/D values
I will try to work on what you saidâŚ
But there is perhaps already a simple way to find that total somewhere ?
Or have you a script that can provide the playerâs K/D ?
thanks 
if you want to show it on a site, why not use vsp stats then?
like this http://et.qubenet.net/stats-et07.php
thank but I do not search an offline solution
I search to display a pure K/D online (during the gaming) [not offline] 
Something clean ânot pollutedâ like was the !howfair
and too because some features seems broken on some versions of ETPub servers
There is simply K/D LUA Script coded by myself, I use it just for own server. http://polish-frags.pl/staty.php
You can test in on our server, just enter on your console !ratio ( your ratio (kills/deaths) + rank on server )
The script works with MySQL.
Thank
But is there no solution that could work without the necessity of using PHP ???
Because I do not want to manage PHP.
Something that work with the Native LUA ??
Like I said, You can simply enter !ratio on the server, player stats are saved into database, PHP displays it only.
Its a LuaSQL
[QUOTE=ETdemin;394551]
More the script is simple, less it eat some resourcesâŚ
I do not want to track too much players because on some low powered servers it make server bad frags
Prefer something that can be punctually called by a command
The difficulty come from the fact I need to understand how to get the K/D values[/QUOTE]
Like Phishermans said, itâs really easy to values from sess.kills & sess.deaths.
Thanks but if I am not wrong sess.kills & sess.deaths is only for the Match : it do not give the persistant K/D values. What I search is to get the persistant K/D 
[QUOTE=ETdemin;394582]What I search is to get the persistant K/D[/QUOTE]What is a âpersistent K/Dâ? Like from the second the server went online until now? What would that be for?
Anyway, thereâs no way to access this directly, if you wanted that you would need to save the K/D somewhere at the end of a round and read it at the beginning of the next.
You have understood the K/D total wrongly. 
It should look like this:
Total Axis team K/D is 1.444âŚ
Here is the math:
(P1K + P2K) / (P1K + P2K) = Global K/D
P1 marks Player 1
P2 marks Player 2
K and D are Kills and Deaths.
thank you for your answer I know for the divide but possible only if get stored value
persistant = stored like XP this term is used in many part of the LUA docuementation
Persistant is the stored permanent (in the files) in formation stored like for example it is the case for XP
(By the same way it is impossible to get it by LUA too same problem !)
I search a way to get those informations without managing any PHP and without managing any the necessity to go to look in the file system of xpsave.cfg
Thank you but when you just connect you get with ETPUB 0.9.1 mods :
sess.kills & sess.deaths = 0
Please what kind of division by zero should I do ? 
Please check by yourself that what I said is true 
I am not interested to get the value for the last X minutes but for the whole shown K/D
Including if I need to divide it by myself 
Values of the last X minutes have not interest⌠the permanent value shown when you press the TAB key is useful⌠and sure if I can get Killed & Death datas I can divide to find the good valueâŚ
But I cannot get the values stored in TAB
I get only in return 0⌠mean no persitant
(If I am not wrong I need a way to get the values from Userinfo )
In that case is there a way to get those informations without the necessity to access the xpsave files or without using php & co ? :
thank you for your support 
The best advice so far was to take a look at Kmod and this http://wolfwiki.anime.net/index.php/Lua_Mod_API
Use this as a start:
function et_Obituary( victim, killer, meansOfDeath )
end
With that function you can track kills. (itâs called every time a player is killed)
With that knowledge I could come up with this:
teams = {}
teams[1] = {}
teams[2] = {}
function et_Obituary( victim, killer, meansOfDeath )
local victimteam = tonumber(et.gentity_get(victim, "sess.sessionTeam"))
local killerteam = tonumber(et.gentity_get(killer, "sess.sessionTeam"))
if victimteam ~= killerteam and killer ~= 1022 and killer ~= victim then
teams[killerteam][1]++
teams[victimteam][2]++
end
end
function getKd()
local kd1 = teams[1][1] / teams[1][2]
local kd2 = teams[2][1] / teams[2][2]
end
Which wonât do anything in the game, but itâs a start. By doing some googling I discovered there are 2 teams so I thought a matrix would be an easy solution to store the kills[1] and deaths[2].
The if statement is checking for teamkills, deaths by âThe worldâ and suicides in that order. I deducted this from kmod.lua
Good luck!
EDIT: It is possible that my lua script has some syntax mistakes since I donât know any LUA 
This is my solution, I published it http://mygamingtalk.com/forums/files/file/18-sql-stats-logger/
Anyway its 1.0 version, but I already built better 3.0 version. I will publish it soon.
Thank you for you help 
It seems the only way⌠while Modders will not add the persistant âXP and K/Dâ supportâŚ
[QUOTE=ETdemin;394824]
It seems the only way⌠while Modders will not add the persistant âXP and K/Dâ supportâŚ[/QUOTE]
You sure that they will not? 