Ru/UTIL GetLocalPlayer: Difference between revisions
< Ru
Jump to navigation
Jump to search
mNo edit summary |
Thunder4ik (talk | contribs) m (→top: clean up, added underlinked tag) |
||
Line 1: | Line 1: | ||
{{Underlinked|date=January 2024}} | |||
{{lang|title=UTIL GetLocalPlayer|UTIL GetLocalPlayer}} | {{lang|title=UTIL GetLocalPlayer|UTIL GetLocalPlayer}} | ||
Revision as of 01:22, 6 January 2024

This article needs more
links to other articles to help
integrate it into the encyclopedia. Please help improve this article by adding links
that are relevant to the context within the existing text.
January 2024



January 2024
UTIL_GetLocalPlayer это UTIL, используемый в Source Engine для нахождения локального игрока. Если игра запущена в одиночном режиме, возвращается указатель на структуру локального игрока. Если нет, возвращается NULL.
Использование
//-----------------------------------------------------------------------------
// Цель: Возвращается указатель на игрока если игра запущена в одиночном режиме, если нет - NULL.
//
// Ввод :
// Вывод : CBasePlayer*
//-----------------------------------------------------------------------------
UTIL_GetLocalPlayer()
Пример
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
if ( pPlayer )
{
// Любое действие
}
Vector vecPlayerCenter = UTIL_GetLocalPlayer()->WorldSpaceCenter();