Thread: How too..
View Single Post
Old 01-20-2008, 07:43 PM   #3
A1win
Nutcracker
 
A1win's Avatar
 
Join Date: Sep 2007
Location: Kuopio, Finland
Posts Rated Helpful 0 Times
Send a message via MSN to A1win
Code:
function player_ondamage( player, damageInfo )

	-- Entity that is attacking
	local attacker = damageInfo:GetAttacker()

	-- If no attacker do nothing
	if not attacker then return end

	-- If attacker is a player do nothing
	if not IsPlayer(attacker) then return end
	
	local playerAttacker = CastToPlayer(attacker)
	
	-- If player is damaging self do nothing
	if player:GetId() == playerAttacker:GetId() then return end
	
end
A1win is offline   Reply With Quote