featurelist.orgfeaturelist.org
 
U
D
4 points - posted 181 days ago by Jeff - status: Active - 1 comments watch embed this
userid = es.getuserid(<entity index>) #if index belongs to a player return that player's userid other wise return 0

This would help me a bit I know :) (I was looking through the TF2 events and a few of them just return the index of the player instead of userid)

~J3ff

SuperDave posted on 2008-09-18 17:45:58
That would be hard to differentiate between an userid and an index, but I suppose it's possible.
def findUseridByIndex(index):
index = int(index)
playerlist = es.createplayerlist()
for userid in playerlist:
if playerlist[userid]['index'] == index:
return userid
return es.getuserid(index)

Sorry, this removed the formatting but I think you get the idea.