Userid: Difference between revisions
Jump to navigation
Jump to search
Warning:It can be easy to confuse a player's ID with their entity index, as until someone disconnects from the server they will be in sync.
TomEdwards (talk | contribs) (Created page with 'A '''userid''' is a unique integer given to each player who connects to a server. Numbers are assigned sequentially, and never re-used. IDs are chiefly used to identify play…') |
(Note that userids start at 1) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
A '''userid''' is a unique [[integer]] given to each player who connects to a server. Numbers are assigned sequentially, and never re-used. | A '''userid''' is a unique [[integer]] given to each player who connects to a server. Numbers are assigned sequentially, starting from 1, and never re-used. | ||
IDs are chiefly used to identify players in [[events]]. | IDs are chiefly used to identify players in [[events]]. | ||
{{warning|It can be easy to confuse a player's ID with their [[entity index]], as until someone disconnects from | {{warning|It can be easy to confuse a player's ID with their [[entity index]], as until someone disconnects from the server they will be in sync.}} | ||
== Usage == | == Usage == |
Latest revision as of 19:37, 15 February 2024
A userid is a unique integer given to each player who connects to a server. Numbers are assigned sequentially, starting from 1, and never re-used.
IDs are chiefly used to identify players in events.

Usage
IDs are assigned by the engine, and cannot be changed.
engine->GetPlayerUserId(edict_t*)
player_info_t::userid
IPlayerInfo::GetUserID()