Accessing sess.aWeaponStats

Discussions about ET modding (sdk code, player/weapon modeling)

Moderators: Forum moderators, developers

Post Reply
Hendrek'
Posts: 6
Joined: Tue Sep 13, 2005 5:22 am
Location: Czech Republic
Contact:

Accessing sess.aWeaponStats

Post by Hendrek' »

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
User avatar
=FF=im2good4u
Posts: 3821
Joined: Wed Feb 05, 2003 7:30 am
Location: The Netherlands, HOLLAND
Contact:

Post by =FF=im2good4u »

if its so barbage then sorry to say i bu maybe u should lean some LUA
Hendrek'
Posts: 6
Joined: Tue Sep 13, 2005 5:22 am
Location: Czech Republic
Contact:

Post by Hendrek' »

=FF=im2good4u wrote:if its so barbage then sorry to say i bu maybe u should lean some LUA
hmm... very useful help. thx

This is the output from the LUA script:

player 4, weapon 0: 3307417600,3295985664,1134788608,3307261952,3295363072
player 4, weapon 1: 1137213440,3307339776,3295674368,1135869952,0
player 4, weapon 2: 0,0,1023,0,0
player 4, weapon 3: 0,573263712,1,0,0
player 4, weapon 4: 0,537849280,0,0,0
player 4, weapon 5: 0,0,0,0,0
player 4, weapon 6: 0,0,0,33619969,0
player 4, weapon 7: 0,0,0,0,0
player 4, weapon 8: 0,0,0,0,0
player 4, weapon 9: 0,0,0,0,0
player 4, weapon 10: 0,0,0,0,0
player 4, weapon 11: 0,0,0,0,0
player 4, weapon 12: 0,0,0,0,0
player 4, weapon 13: 0,0,0,0,0
player 4, weapon 14: 0,0,0,0,0
player 4, weapon 15: 0,0,0,0,0
player 4, weapon 16: 0,0,0,0,0
player 4, weapon 17: 0,0,0,0,0
player 4, weapon 18: 0,537202640,0,0,0
player 4, weapon 19: 1,2,0,0,0
player 4, weapon 20: 0,0,0,0,0
player 4, weapon 21: 0,0,0,0,0
User avatar
=FF=im2good4u
Posts: 3821
Joined: Wed Feb 05, 2003 7:30 am
Location: The Netherlands, HOLLAND
Contact:

Post by =FF=im2good4u »

hmm oke its either a singed / unsinged missmatch or broken :p

Code: Select all

// OSP - weapon stat counters
typedef struct {
	unsigned int atts;
	unsigned int deaths;
	unsigned int headshots;
	unsigned int hits;
	unsigned int kills;
} weapon_stat_t;
McSteve
Posts: 113
Joined: Tue Sep 12, 2006 7:41 am

Post by McSteve »

Does anyone have any further information on this? I've been having the same problem.

thanks in advance
GhosT:McSteve
Ghostworks Gaming Community
User avatar
ReyalP
Posts: 1663
Joined: Fri Jul 25, 2003 11:44 am

Post by ReyalP »

It's bugged, wait for the next release.
send lawyers, guns and money
McSteve
Posts: 113
Joined: Tue Sep 12, 2006 7:41 am

Post by McSteve »

:(

Any workaround?
GhosT:McSteve
Ghostworks Gaming Community
User avatar
ReyalP
Posts: 1663
Joined: Fri Jul 25, 2003 11:44 am

Post by ReyalP »

McSteve wrote::(

Any workaround?
I'm afraid not. :(
send lawyers, guns and money
Post Reply