View Single Post
voogru
Inspector Javert
Join Date: Oct 2004
Old 06-27-2009 , 03:38   Re: g_pGameRules question
Reply With Quote #6

You don't need a signature to obtain the gamerules fyi.


Find the "tf_gamerules" entity, when it spawns:

Code:
ServerClass *pServerClass = SH_MCALL(BaseEntity(), GetServerClass)();
	void		*pTFGameRules = NULL;

	if(pServerClass)
	{
		int i, iCount;
		iCount = pServerClass->m_pTable->GetNumProps();
		for(i = 0;i < iCount ;i++) 
		{
			if(FStrEq(pServerClass->m_pTable->GetProp(i)->GetName(), "tf_gamerules_data")) 
			{
				pTFGameRules = (*pServerClass->m_pTable->GetProp(i)->GetDataTableProxyFn())(NULL, NULL, NULL, NULL, 0);
				break;
			}
		}		
	}
Wham, bam, gamerules pointer.
voogru is offline