Es.getuserid
From EventScripts Community Encyclopedia
|
[edit] Method: getuseridModule: es [edit] Method Overview[edit] Table of Contents
[edit] DescriptionSearches all online users to see if their STEAMID, userid, or name matches the match-text. This is the Python equivalent of: http://www.eventscripts.com/pages/es_getuserid [edit] Arguments
[edit] Examplesimport es def load(): # Check to see if the say command exists first if not es.exists('saycommand', 'find'): # If it doesn't, register the 'find' say command to the 'findplayer' block es.regsaycmd('find','scriptname/findplayer') def findplayer(): # Get the userid of the player that ran the find command userid = es.getcmduserid() # Get the player name/partial name they provided player = es.getargv(1) # Check using es.getuserid() to see if this user exists # This is the same as doing es.getuserid(player_userid,player) player_userid = es.getuserid(player) # If it does..... if player_userid: # Then get the players name player_name = es.getplayername(player_userid) # And tell the player that ran the command what the players full name and userid is es.tell(userid,'Found player',player_name,'with userid',player_userid) # Otherwise... else: # Tell the player that es.getuserid() couldn't find any userid from that name es.tell(userid,'Could not find player.') [edit] Notes
[edit] See Also |
|
