View Single Post
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 05-27-2021 , 16:28   Re: Get player info from CTFPlayer *
Reply With Quote #2

In case somebody needs it. The pointer can be cast to IServerEntity. This interface has a method to get the entity index:
(IServerEntity -> IServerUnknown -> IHandleEntity -> GetRefEHandle)
const CBaseHandle& baseHandle = baseEntity_->GetRefEHandle();
int index = baseHandle.GetEntryIndex();

Then the info can be received this way:
IGamePlayer * player = playerhelpers->GetGamePlayer(index);

Last edited by kadet.89; 05-27-2021 at 16:34.
kadet.89 is offline
Send a message via Skype™ to kadet.89