auto wanted when you shoot a cop

how do you make it so that if anyone shoots a cop ( not just chief and cp but all of them ) they are auto wanted

GM/EntityTakeDamage
ply:wanted()


function GM:EntityTakeDamage( target, dmginfo )

	if ( target:Iscp() ) then
ply:wanted()

[editline]17th May 2015[/editline]

that ? sorry not very good at lua

not sure if this will work but



function GM:EntityTakeDamage( target, attacker )
	if target:Team() == 'cp' then
		attacker:Wanted()
	end
end


CTakeDamageInfo:GetAttacker
Make the player returned by that wanted.

Teams are not referenced to strings unless using team/GetName. Teams are number based, so what you have will not work.

Look at the darkrp wiki, that will tell you what you need to know in order to check if people are government based.

http://forum.facepunch.com/showthread.php?t=1453952 :v