View Single Post
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 04-15-2006 , 14:58  
Reply With Quote #4

It effects every event :\
Every event that you use has a userid and attacker id, they are both UserID's and not Entity Index's.

Code:
edict_t *EdictOfUserId( int UserId )
{
	int i;
	edict_t *pEnt;
	for  (i=1; i<MAX_PLAYERS; i++)
	{
		pEnt = m_Engine->PEntityOfEntIndex(i);
		if (pEnt && !pEnt->IsFree())
		{
			if (FStrEq(pEnt->GetClassName(), "player"))
			{
				if (m_Engine->GetPlayerUserId(pEnt)==UserId)
				{
					return pEnt;
				}
			}
		}
	}

	return NULL;
}
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3