pi = FindItemBySerial(vecContainer[ci]);
void usehairdye(UOXSOCKET s, ITEM x)	// x is the hair dye bottle object number{	const P_ITEM piDye=MAKE_ITEMREF_LR(x);	// on error return	int ci=0,loopexit=0;	P_ITEM pi;	P_CHAR pc_currchar = MAKE_CHARREF_LR(currchar[s]);	while ( ((pi=ContainerSearch(pc_currchar->serial,&ci)) != NULL) && (++loopexit < MAXLOOPS) )	{		if(pi->layer==0x10 || pi->layer==0x0B)//beard(0x10) and hair		{			pi->color1=piDye->color1;	//Now change the color to the hair dye bottle color!			pi->color2=piDye->color2;			RefreshItem(pi);		}	}	Items->DeleItem(piDye);	//Now delete the hair dye bottle!}