No DNA on TTT Custom Weapon

This may be a simple and easy question, but how can I disable DNA on a custom weapon I found. So DNA will not be found on people killed with it?

Is it impossible to do? I swear I remember reading something a log time ago that supposedly did the trick.

So, if you’re talking about SWEP (anything can happen):



function SWEP:OnDrop() -- or PreDrop()
	self.fingerprints = {}
end


I mean the DNA on dead bodies that you have killed with the weapon.

Example: Player A kills player B with custom weapon, there is no DNA on player B’s body.

There is only DNA on this ragdoll if the damage made by the weapon has one of the following damage types: DMG_BULLET, DMG_SLASH, DMG_CLUB

So if you want that your weapon doesn’t leave DNA on ragdolls you have to use another DamageType or you have to override the function.
The first way is the better way.

For more you can take a look at this:

It would only be for DMG_BULLET, and I was thought you could add the code needed to the bottom of the custom weapon and use a hook. Then it would then only override DMG_BULLET if the player was killed by the custom weapon, right? I’m still trying to figure out how to achieve this. Can anyone help?

@ncc360
btw. you can alternatively do this:



hook.Add("PlayerDeath", "DelDNACustomSWEP", function(victim, infl, attacker)
    if IsValid(infl) and infl:IsWeapon() and infl:GetClass() == "YOUR_WEAPON_CLASS" then
        local rag_ent = victim.server_ragdoll
        rag_ent.killer_sample = nil
    end
end)


Just to make sure, I replace YOUR_WEAPON_CLASS with DMG_BULLET for no DNA on bullet kills with the custom weapon? Or leave the code exactly the same?

put the class of the weapon in that space, like m9k_ak47 or whatever it is.