English steamstats command not working

3 replies
Goto Page
To the start Previous 1 Next To the start
Up
mozilla1
User
Offline Off
I'm trying to get the seconds spent on server using steam data, but it always returns "false" as value.


IMG:https://i.imgur.com/lxACg8t.png


Here is the sample script:

Code:
1
2
3
4
5
6
local usgn = player(uid,"usgn")
local steam = player(uid,"steamid")
local secs=0
if usgn~=0 then secs = secs+stats(usgn,"secs") end
if steam~="0" then secs = secs+steamstats(steam,"secs") end
return secs
28.12.17 11:02:12 am
Up
DC
Admin
Offline Off
Check the source of your uid variable. I assume it's wrong (e.g. mixed up parameter order in a hook). Player commands will just return false if the player does not exist.

Either make sure that uid is always a valid player ID or add a check to handle this situation. You can use
if player(uid,"exists") then
to check if a player actually exists.

A simple
lua print(player(1,"steamid"))
works fine for me.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
29.12.17 04:38:53 pm
Up
mozilla1
User
Offline Off
Buti i tested on myself (on id 1), logged in steam and the "false" message still appears

I don't need just the steamid, i need the seconds spent.

The source of "uid" is ok, because the usgn stats are showing just fine, also the player(uid,'steamid') is fine, the real problem is the steamstats command
30.12.17 08:09:16 pm
Up
SQ
Moderator
Offline Off
I've fixed it for the next version. There was unnecessary 32 bit integer assignment for 64bit long steamID.
edited 1×, last 30.12.17 10:37:10 pm
To the start Previous 1 Next To the start