View Single Post
Eden.Campo
Member
Join Date: Mar 2013
Old 07-29-2013 , 12:53   Re: help with func_physbox(ball)
Reply With Quote #3

Code:
new LastAttacker;

public OnEntityCreated(edict, const String:classname[])
{
	if(IsValidEdict(edict) && IsValidEntity(edict))
	{
		if(StrEqual(classname, "func_physbox"))
		{
			SDKHook(edict, SDKHook_OnTakeDamage, OnEntityTakeDamage);
		}
	}
}

public Action:OnEntityTakeDamage(edict, &inflictor, &attacker, &Float:damage, &damagetype)
{
	if(IsValidEdict(edict) && IsValidEntity(edict))
	{
		LastAttacker = attacker;
	}
	
	return Plugin_Continue;
}

Last edited by Eden.Campo; 07-29-2013 at 12:53.
Eden.Campo is offline