Help with anti-RDM

for some reason i cant get this code to work, As is it doesnt work at all if someone can help me out i would be very greatful

[lua]
function CheckForRDM(victim, _, killer)

if( !victim:Alive() ) then 
victim:Spawn() 
end
end

function RdmRegulate(victim, _, killer)
if(victim:IsPlayer() && killer:IsPlayer()) then – Check if they’re both players (should be)

    if(!killer.LastKillTime) then killer.LastKillTime = CurTime() end -- Set Kill Time if not exist
    if(!killer.LastKillCount) then killer.LastKillCount = 0 end -- Set Kill counter if not exist
    if(!killer.LastKilled || killer.LastKilled != victim) then 
        killer.LastKilled = victim 
        killer.LastKillCount = 0
    end
		
   if (victim:SteamID() == killer:SteamID()) then  -- is the same person
           PrintMessage( HUD_PRINTTALK, (" Suicide!"))
	end
	
    if(killer.LastKillCount = victim ) then killer.LastKillCount = killer.LastKillCount + 1 -- Check if its the first time the killer kills someone
            
	if(killer.LastKillTime < CurTime() - 120 && killer.LastKilled == victim) then
	
			PrintMessage( HUD_PRINTTALK, (killer:Name().." has been arrested for RDM!")) -- Send text to all players chat!
            game.ConsoleCommand("rp_arrest "..killer:Name().." 160

")
killer.LastKillCount = killer.LastKillCount + 1

			else
			
	
		if(killer.LastKillCount > 5 ) then -- If killer have killed less then 4 times then continue
	
		game.ConsoleCommand("kickid "..killer:UniqueID().." Kicked for RDM

")

		else

	if(killer.LastKillCount > 6 ) then
	
	    game.ConsoleCommand("banid ".. killer:UniqueID().." Banned for RDM

")

				end
    
			end
		end   
	end
end

end
hook.Add(“PlayerDeath”, “RdmCheck”, RdmRegulate)
[/lua]

oh and this isnt more of a help request its a request for someone to recode to work

sbox_plpldamage 0

Its already 0 dumbass

No need to be an asshole about it, your question is stupid to begin with.

Add debug prints, find where shit is going wrong, and fix it yourself. You’ll learn more, and maybe you’ll get some humility along the way.

Well its like saying “How do i set a color”. Yes i have a basic understanding but i just needed someone to actually be even the slightest bit helpful.

There’s a wonderful thing called decent administrators.

Gmod rp is just stupid, there is a higher roleplay factor in l4d than in gmod rp.

But lets not go off topic, there is no need for anti-rdm scripts as there is no real way of identifying if someone is killed in a raid, or killed randomly.

You were going to use it for roleplay perposes, right? Because otherwise you can just disable pvp damage

well i did and it didnt work. it just overrides it anyway

Jesus Christ, honestly, nobody cares about your opinion regarding DarkRP. Your post would be perfect if you didn’t add in your pointless opinion. e

And OP, this could be dangerous as something like a click before lag or crossfire could lead to a mis-ban.

I suggest just using the Convar for excessive deathmatch in DarkRP.

Calling someone a dumbass, who tried to help means:
You aren’t worthy of the replies of helpful people. Go somewhere else where people might appreciate being treated like garbage.

My opinion:
There’s no way to prove that was RDM or not, only a brain can monitor a party of brain(s).
That’s why there’s a thing called Active Administrators. Use those, and most kicks/bans will be valid.
Use this, and you might get kicked while raiding a bunch of people.
Speaking of which, this script does seem to be more like a anti-repetitive same person kill. It will probably kick/ban a guy who is raging at a RDMer and killing him constantly, instead of the RDMer him self.

The point of it is it only works if the person kills the SAME person twice not 5 different people

Honestly there is no real fool proof way to detect an rdm’er, like nick_9_8 said, it can be risky if a crossfire or lag spike occurs. Just enable death logs for the administrators so you can see who killed who. You’ll have a better understanding of the situation, because you know who started the rdm.

Exactly… I suggest using these people called ‘Admins’, they shall help you :slight_smile: