players.helpers module

Provides helper functions specific to players.

players.helpers.address_from_playerinfo(playerinfo)[source]

Return the IP address for the given player.

If the player is a bot, an empty string will be returned.

Parameters:playerinfo (PlayerInfo) – The PlayerInfo instance to get the UniqueID from.
Returns:The IP address. E.g. ‘127.0.0.1:27015’
Return type:str
players.helpers.baseentity_from_playerinfo((PlayerInfo)PlayerInfo) → object :

Return the BaseEntity (of type “CBaseEntity *”) from the given PlayerInfo (of type “IPlayerInfo *”).

players.helpers.baseentity_from_userid((int)Userid) → object :

Return the BaseEntity (of type “CBaseEntity *”) from the given Userid (of type “unsigned int”).

players.helpers.basehandle_from_playerinfo((PlayerInfo)PlayerInfo) → BaseEntityHandle :

Return the BaseHandle (of type “CBaseHandle”) from the given PlayerInfo (of type “IPlayerInfo *”).

players.helpers.basehandle_from_userid((int)Userid) → BaseEntityHandle :

Return the BaseHandle (of type “CBaseHandle”) from the given Userid (of type “unsigned int”).

players.helpers.edict_from_playerinfo((PlayerInfo)PlayerInfo) → Edict :

Return the Edict (of type “edict_t *”) from the given PlayerInfo (of type “IPlayerInfo *”).

players.helpers.edict_from_userid((int)Userid) → Edict :

Return the Edict (of type “edict_t *”) from the given Userid (of type “unsigned int”).

players.helpers.get_client_language(index)[source]

Return the language of the given client.

Parameters:index (int) – Index of the client.
players.helpers.index_from_name(name)[source]

Return an index from the given player name.

Parameters:name (str) – The player name to get the index of.
Return type:int
players.helpers.index_from_playerinfo((PlayerInfo)PlayerInfo) → int :

Return the Index (of type “unsigned int”) from the given PlayerInfo (of type “IPlayerInfo *”).

players.helpers.index_from_steamid(steamid)[source]

Return an index from the given SteamID.

Parameters:steamid (str) – The SteamID to get the index of.
Return type:int
players.helpers.index_from_uniqueid(uniqueid)[source]

Return an index from the given UniqueID.

Parameters:uniqueid (str) – The UniqueID to get the index of.
Return type:int
players.helpers.index_from_userid((int)Userid) → int :

Return the Index (of type “unsigned int”) from the given Userid (of type “unsigned int”).

players.helpers.inthandle_from_playerinfo((PlayerInfo)PlayerInfo) → int :

Return the IntHandle (of type “unsigned int”) from the given PlayerInfo (of type “IPlayerInfo *”).

players.helpers.inthandle_from_userid((int)Userid) → int :

Return the IntHandle (of type “unsigned int”) from the given Userid (of type “unsigned int”).

players.helpers.playerinfo_from_baseentity((object)BaseEntity) → PlayerInfo :

Return the PlayerInfo (of type “IPlayerInfo *”) from the given BaseEntity (of type “CBaseEntity *”).

players.helpers.playerinfo_from_basehandle((BaseEntityHandle)BaseHandle) → PlayerInfo :

Return the PlayerInfo (of type “IPlayerInfo *”) from the given BaseHandle (of type “CBaseHandle”).

players.helpers.playerinfo_from_edict((Edict)Edict) → PlayerInfo :

Return the PlayerInfo (of type “IPlayerInfo *”) from the given Edict (of type “edict_t *”).

players.helpers.playerinfo_from_index((int)Index) → PlayerInfo :

Return the PlayerInfo (of type “IPlayerInfo *”) from the given Index (of type “unsigned int”).

players.helpers.playerinfo_from_inthandle((int)IntHandle) → PlayerInfo :

Return the PlayerInfo (of type “IPlayerInfo *”) from the given IntHandle (of type “unsigned int”).

players.helpers.playerinfo_from_pointer((Pointer)Pointer) → PlayerInfo :

Return the PlayerInfo (of type “IPlayerInfo *”) from the given Pointer (of type “CPointer *”).

players.helpers.playerinfo_from_userid((int)Userid) → PlayerInfo :

Return the PlayerInfo (of type “IPlayerInfo *”) from the given Userid (of type “unsigned int”).

players.helpers.pointer_from_playerinfo((PlayerInfo)PlayerInfo) → Pointer :

Return the Pointer (of type “CPointer”) from the given PlayerInfo (of type “IPlayerInfo *”).

players.helpers.pointer_from_userid((int)Userid) → Pointer :

Return the Pointer (of type “CPointer”) from the given Userid (of type “unsigned int”).

players.helpers.uniqueid_from_index(index)[source]

Return the UniqueID for the given player index.

Parameters:index (int) – The player index to get the UniqueID from.
Returns:The UniqueID of the player. E.g. ‘BOT_STAN’ or ‘STEAM_0:0:12345’
Return type:str
players.helpers.uniqueid_from_playerinfo(playerinfo)[source]

Return the UniqueID for the given player.

Parameters:playerinfo (PlayerInfo) – The PlayerInfo instance to get the UniqueID from.
Returns:The UniqueID of the player. E.g. ‘BOT_STAN’ or ‘STEAM_0:0:12345’
Return type:str
players.helpers.userid_from_baseentity((object)BaseEntity) → int :

Return the Userid (of type “unsigned int”) from the given BaseEntity (of type “CBaseEntity *”).

players.helpers.userid_from_basehandle((BaseEntityHandle)BaseHandle) → int :

Return the Userid (of type “unsigned int”) from the given BaseHandle (of type “CBaseHandle”).

players.helpers.userid_from_edict((Edict)Edict) → int :

Return the Userid (of type “unsigned int”) from the given Edict (of type “edict_t *”).

players.helpers.userid_from_index((int)Index) → int :

Return the Userid (of type “unsigned int”) from the given Index (of type “unsigned int”).

players.helpers.userid_from_inthandle((int)IntHandle) → int :

Return the Userid (of type “unsigned int”) from the given IntHandle (of type “unsigned int”).

players.helpers.userid_from_playerinfo((PlayerInfo)PlayerInfo) → int :

Return the Userid (of type “unsigned int”) from the given PlayerInfo (of type “IPlayerInfo *”).

players.helpers.userid_from_pointer((Pointer)Pointer) → int :

Return the Userid (of type “unsigned int”) from the given Pointer (of type “CPointer *”).