banimod / etpro / ettv forums Forum Index banimod / etpro / ettv forums
Bani's Discussion Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Accessing sess.aWeaponStats

 
Post new topic   Reply to topic    banimod / etpro / ettv forums Forum Index -> ET Modding
View previous topic :: View next topic  
Author Message
Hendrek'



Joined: 13 Sep 2005
Posts: 6
Location: Czech Republic

PostPosted: Sat Jun 10, 2006 12:27 pm    Post subject: Accessing sess.aWeaponStats Reply with quote

How can I access sess.aWeaponStats from LUA ? The appended code prints only garbrage Sad

Code:
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
Back to top
View user's profile Send private message Visit poster's website
=FF=im2good4u



Joined: 05 Feb 2003
Posts: 3924
Location: The Netherlands, HOLLAND

PostPosted: Sat Jun 10, 2006 10:38 pm    Post subject: Reply with quote

if its so barbage then sorry to say i bu maybe u should lean some LUA
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Hendrek'



Joined: 13 Sep 2005
Posts: 6
Location: Czech Republic

PostPosted: Sun Jun 11, 2006 12:20 am    Post subject: Reply with quote

=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
Back to top
View user's profile Send private message Visit poster's website
=FF=im2good4u



Joined: 05 Feb 2003
Posts: 3924
Location: The Netherlands, HOLLAND

PostPosted: Tue Jun 13, 2006 5:36 am    Post subject: Reply with quote

hmm oke its either a singed / unsinged missmatch or broken :p
Code:
// OSP - weapon stat counters
typedef struct {
   unsigned int atts;
   unsigned int deaths;
   unsigned int headshots;
   unsigned int hits;
   unsigned int kills;
} weapon_stat_t;

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
McSteve



Joined: 12 Sep 2006
Posts: 112

PostPosted: Mon Nov 20, 2006 12:30 am    Post subject: Reply with quote

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

thanks in advance
_________________
GhosT:McSteve
Ghostworks Gaming Community
Back to top
View user's profile Send private message
ReyalP



Joined: 25 Jul 2003
Posts: 1663

PostPosted: Mon Nov 20, 2006 12:41 am    Post subject: Reply with quote

It's bugged, wait for the next release.
_________________
send lawyers, guns and money
Back to top
View user's profile Send private message
McSteve



Joined: 12 Sep 2006
Posts: 112

PostPosted: Mon Nov 20, 2006 1:07 am    Post subject: Reply with quote

Sad

Any workaround?
_________________
GhosT:McSteve
Ghostworks Gaming Community
Back to top
View user's profile Send private message
ReyalP



Joined: 25 Jul 2003
Posts: 1663

PostPosted: Mon Nov 20, 2006 2:05 am    Post subject: Reply with quote

McSteve wrote:
Sad

Any workaround?

I'm afraid not. Sad
_________________
send lawyers, guns and money
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    banimod / etpro / ettv forums Forum Index -> ET Modding All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group