This is cl_rdmmanager.lua
include("player_ext_shd.lua") function PlayerTookDamage(victim, attacker) if attacker:IsPlayer() and victim:IsPlayer() and IsValid(victim) and IsValid(attacker) then if attacker:GetRole() == ROLE_INNOCENT and victim:GetRole() == ROLE_INNOCENT then attacker:ChatPrint( "You RDM'd " .. victim:Nick() ) victim:ChatPrint( attacker:Nick() .. " RDM'd you and has been warned." ) end end end hook.Add("PlayerHurt", "PlayerTookDamage", PlayerTookDamage)
cl_rdmmanager.lua is located in “gamemodes errortown\gamemode” along with init.lua.
In init.lua, I have AddCSLuaFile(“cl_rdmmanager.lua”)
I’ve tried everything and can’t seem to get it to work. The basic idea is to warn the attacker if he is innocent and shoots another innocent. I only have it print the message for now so I can see if it works. Once it actually works I’m removing the message and utilizing the hook to the servers advantage so the server will handle RDM’s on its own. Anyone know what I’m doing wrong here?