View Single Post
davejk
Junior Member
Join Date: Mar 2009
Old 09-03-2009 , 17:30   Re: TF2 Halo Remover
Reply With Quote #12

Quote:
Originally Posted by irmrbean View Post
Would it be possible to message the player and explain why there halo is not working? Been tryin to figure out how to do it but i cant figure out how to get a name out of which entity the halo belongs to.
Change the CheckInventory code to this:
Code:
public Action:CheckInventory(Handle:timer)
{
	new edict, itemOwner;
	while((edict = FindEntityByClassname(edict, "tf_wearable_item")) != -1)
	{
		if(GetEntProp(edict, Prop_Send, "m_iItemDefinitionIndex") == 125) {
			itemOwner = GetEntPropEnt(edict, Prop_Send, "m_hOwnerEntity");
			PrintToChat(itemOwner, "\x01Your \x04halo\x01 was \x05removed\x01.");
			RemoveEdict(edict);
			edict++;
		}
	}
}
I didn't include an explanatory message because it would appear every time they respawn or use a resupply cabinet, which is very spammy.
davejk is offline