Forum

> > CS2D > Scripts > steamstats command not working
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch steamstats command not working

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt steamstats command not working

mozilla1
User Off Offline

Zitieren
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:

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

alt Re: steamstats command not working

DC
Admin Off Offline

Zitieren
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.

alt Re: steamstats command not working

mozilla1
User Off Offline

Zitieren
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

alt Re: steamstats command not working

SQ
Moderator Off Offline

Zitieren
I've fixed it for the next version. There was unnecessary 32 bit integer assignment for 64bit long steamID.
1× editiert, zuletzt 30.12.17 22:37:10
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht