Anyway, try this :
addEventHandler("onClientPlayerDamage", getLocalPlayer(),
function ( attacker )
if ( getElementType( attacker ) == "player" ) then
cancelEvent()
end
end
)
hmm, i think you mean like this :
ped = createPed(0, x, y, z)
addEventHandler("onClientPedDamage", ped,
function ( attacker )
if ( getElementType(attacker) == "player" ) then
cancelEvent()
end
end
)