Accessing sess.aWeaponStats
Posted: Sat Jun 10, 2006 12:27 pm
How can I access sess.aWeaponStats from LUA ? The appended code prints only garbrage
Code: Select all
function et_InitGame( levelTime, randomSeed, restart )
maxclients = tonumber( et.trap_Cvar_Get( "sv_maxClients" ) )
end
function et_Print( text )
local s, e = string.find( text, "Exit: " )
if s == 1 then
ShowStats( )
end
end
function ShowStats( )
local i
for i = 0, maxclients - 1 do
local team = et.gentity_get( i, "sess.sessionTeam" )
if team == 1 or team == 2 then
for j = 0, 21 do
local stats = et.gentity_get( i, "sess.aWeaponStats", j )
et.G_Print( "player " .. i .. ", weapon " .. j .. ": " .. stats[1] .. "," .. stats[2] .. "," .. stats[3] .. "," .. stats[4] .. "," .. stats[5] .. "\n" )
end
end
end
end