Darkrp Teams

Ok So I Was Testing around with the playershouldtakedamage hook, and im currently testing this on darkrp but anyways the argument I made here doesnt really seem to work.

My Code:




function GM:PlayerShouldTakeDamage( ply, attacker )
if ply:IsPlayer() then
	if ply:Team() == attacker:Team() then
		return false
	end
end
 	return true
end




Use it as a hook instead of overwriting the core function.

Example I wrote, which works with DarkRP: -snip ( finding correct tutorial )- https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/anti_teamkill_system.lua.html - Useful for when you have many different jobs set up which are meant to be the same team; if you wanted it to be no team-damage between same jobs, it is easily modified to accomplish that.

Instead of TEAM_BLAH = 1;, with DarkRP you need to use the commented lines which are: [ TEAM_BLAH ] = 1; // or 2, or whichever team they are on…

So I make a Addon and make the directory as told and I put the code in and for some reason everybody now cant pvp.

Updated the link; wrapped the table in an InitPostEntity hook to ensure DarkRP has time to create the teams before using the values.