Page 1 of 1

[CS:GO] How to get userid by SteamID ?

Posted: Thu Mar 07, 2019 7:12 am
by copyerfiled
Could you tell me the way how to get userid by steamid?

Re: [CS:GO] How to get userid by SteamID ?

Posted: Thu Mar 07, 2019 7:40 am
by L'In20Cible

Syntax: Select all

from players.helpers import index_from_steamid, userid_from_index

userid = userid_from_index(index_from_steamid('STEAM_1:2:3456789'))

Re: [CS:GO] How to get userid by SteamID ?

Posted: Thu Mar 07, 2019 7:52 am
by copyerfiled
L'In20Cible wrote:

Syntax: Select all

from players.helpers import index_from_steamid, userid_from_index

userid = userid_from_index(index_from_steamid('STEAM_1:2:3456789'))

It works! Thank you very much!
Can I ask you one more question? How to get all the players on the server?

Re: [CS:GO] How to get userid by SteamID ?

Posted: Thu Mar 07, 2019 7:54 am
by Ayuto

Syntax: Select all

from filters.players import PlayerIter

for player in PlayerIter():
print(player.name)
Though, if it's a performance critical part, you might want to use PlayerGenerator. It returns Edict instances.

Re: [CS:GO] How to get userid by SteamID ?

Posted: Thu Mar 07, 2019 8:14 am
by copyerfiled
Ayuto wrote:

Syntax: Select all

from filters.players import PlayerIter

for player in PlayerIter():
print(player.name)
Though, if it's a performance critical part, you might want to use PlayerGenerator. It returns Edict instances.

Thank you very much!