currently i would retrieve it this way;
Syntax: Select all
from Source import Player
for player in Player.Players():
if player.GetUserID() == userid:
steam_id = player.GetNetworkIDString()
tag = player.GetName()
Syntax: Select all
from Source import Player
for player in Player.Players():
if player.GetUserID() == userid:
steam_id = player.GetNetworkIDString()
tag = player.GetName()
Monday wrote:I believe so.. We may later add library methods that do the looping for you, but all that will provide is a little less work on your end.
Satoon has been messing with the player stuff much more than I have, so maybe he will chime in.
Syntax: Select all
myPlayer = Player.PlayerOfUserid(userid)
steamid = myPlayer.GetNetworkIDString()
tag = myPlayer.GetName()
Tuck wrote:well looping is fine though, maybe it's just me but wouldnt a api that stores the IPlayerInfo in a dict where each key is a userid be even faster than having to loop? :)
Monday wrote:I'm not sure about this... but I think this would work:Syntax: Select all
myPlayer = Player.PlayerOfUserid(userid)
steamid = myPlayer.GetNetworkIDString()
tag = myPlayer.GetName()
Try it out?
Return to “Plugin Development Support”
Users browsing this forum: Bing [Bot] and 68 guests