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