for(int i=1;i<=maxplayers;i++) { edict_t *pEntity = engine->PEntityOfEntIndex(i); if(!pEntity || pEntity->IsFree()) { continue; } int uid = engine->GetPlayerUserId(pEntity); }
Josh wrote:
OK all I have is the playerid (userid). How do I get a pointer to the entity having this userid? And I CANNOT use IndexOfEdict b/c that is a different number.
For example, I join a game then I call the iplayerinfo on myself and find out that my userid is 2. But IndexOfEdict is 1. They are different.
Josh
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marcelo Bezerra Sent: Monday, December 20, 2004 12:36 PM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] Finding the entity based on the userid
You can look from 1 to maxplayers, get the pEntity and use: engine->GetPlayerUserId(pEntity);
Loop from Josh wrote:
This is a multi-part message in MIME format. -- [ Picked text/plain from multipart/alternative ] I was just wondering how I can get an entity or an index of the entity that is "fired".
Meaning the player_hurt event is fired and I get a userid of 2. Will this is different than the IndexOfEdict function in engine. How can I determine the IndexOfEdict or get the pointer to the entity of a userid?
Thanks,
Josh
--
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders

