UTIL PlayerByIndex: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Added Stub tag - Needs examples)
No edit summary
Line 9: Line 9:
{{stub}}
{{stub}}
{{todo|Examples?}}
{{todo|Examples?}}
[[Category:Programming]]
[[Category:UTIL]]

Revision as of 17:38, 10 April 2011

CBasePlayer *UTIL_PlayerByIndex( int entindex ) { return ToBasePlayer( ClientEntityList().GetEnt( entindex ) );

Players entities range from 1 - MAXPLAYERS, and non-players entities start at MAXPLAYERS + 1. I.E if A joins (1), then B joins (2) then A leaves 1 will free up, Player C joins (1)

(much thanks to DaFox for providing this information).

gpGlobals->maxClients will return the number of connected clients.

Stub

This article or section is a stub. You can help by expanding it.

Todo: Examples?