Get player info from CTFPlayer *
I am writing an extension and am hooking a function that is only passed a CTFPlayer * as a parameter. Does anyone know how to get player info from it, such as steam id / ip address / userid, etc?
And conversely, is there a way to get the CTFPlayer * from a player's userid? Thanks. |
Re: Get player info from CTFPlayer *
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); |
All times are GMT -4. The time now is 23:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.