Thread: Private Data
View Single Post
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 12-20-2004 , 13:26  
Reply With Quote #14

Quote:
Originally Posted by Fruchtzwerg
Quote:
Originally Posted by Pimp Daddy
But it I change the &= to = then it works, but that is basically erasing other data that is in that offset
That is because you use int pointers, but the data isn't int. Use the correct data size and it will not change other parameters.
How do I determine the correct data size?

this also worked after initial testing:


Code:
void CPlayer::set_user_defuser( bool bValue )
{

	if( bValue )
	{
		*((int *)pEnt->GetUnknown() + OFFSET_ITEM) |= (1<<0);
		*((int *)pEnt->GetUnknown() + OFFSET_ITEM_ICON) |= (1<<0);
	}
	else
	{
		*((int *)pEnt->GetUnknown() + OFFSET_ITEM) -= (1<<0);
		*((int *)pEnt->GetUnknown() + OFFSET_ITEM_ICON) -= (1<<0);
	}
}
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu