print("TTT Tools is loading") if not GetConVarString("gamemode") == "terrortown" then return end function ulx.notify(calling_ply,should_see) if not should_see then calling_ply.CanSeeRDMNotify = true ULib.tsay( calling_ply, "RDM notifications enabled") else calling_ply.CanSeeRDMNotify = false ULib.tsay( calling_ply,"RDM notifications disabled") end end local notify = ulx.command("TTT Tools", "ulx notify", ulx.notify, "!notify",true) notify:defaultAccess( ULib.ACCESS_ADMIN ) notify:addParam{ type=ULib.cmds.BoolArg, invisible=true } notify:help( "Enable/disable RDM notifications." ) notify:setOpposite( "ulx unnotify", {_, true}, "!unnotify",true ) function rdmnotify(victim, weapon, killer) if GetRoundState() == ROUND_ACTIVE then if not killer:IsPlayer() then return end for k,v in pairs(player.GetAll()) do if v.CanSeeRDMNotify then if (killer:GetRole() == 1 and victim:GetRole() == 1) then ULib.tsayColor( v,false, Color(0,200,0),killer:Nick(),Color(255,0,0)," (Traitor)",Color(151,211,255), " killed ",Color(0,200,0),victim:Nick(),Color(255,0,0)," (Traitor)") elseif (killer:GetRole() == 2 and victim:GetRole() == 2) then ULib.tsayColor( v,false, Color(0,200,0),killer:Nick(),Color(20,20,255)," (Detective)",Color(151,211,255), " killed ",Color(0,200,0),victim:Nick(),Color(20,20,255)," (Detective)") elseif (killer:GetRole() == 2 and victim:GetRole() == 0) then ULib.tsayColor( v,false, Color(0,200,0),killer:Nick(),Color(20,20,255)," (Detective)",Color(151,211,255), " killed ",Color(0,200,0),victim:Nick(),Color(0,255,0)," (Innocent)") elseif (killer:GetRole() == 0 and victim:GetRole() == 2) then ULib.tsayColor( v,false, Color(0,200,0),killer:Nick(),Color(0,255,0)," (Innocent)", Color(151,211,255), " killed ",Color(0,200,0),victim:Nick(),Color(20,20,255)," (Detective)") elseif (victim:GetRole() == 0 and killer:GetRole() == 0) then ULib.tsayColor( v,false, Color(0,200,0),killer:Nick(),Color(0,255,0)," (Innocent)", Color(151,211,255), " killed ",Color(0,200,0),victim:Nick(),Color(0,255,0)," (Innocent)") end end end end end hook.Add("PlayerDeath","rdmnotify",rdmnotify) function ulx.settraitornr(calling_ply,target_ply) ulx.fancyLogAdmin( calling_ply, true, "#A made #T traitor next round.", target_ply) target_ply:SetNWBool("TraitorNR",true) end local settraitornr = ulx.command("TTT Tools", "ulx settraitornr", ulx.settraitornr, "!settraitornr",true) settraitornr:defaultAccess( ULib.ACCESS_ADMIN ) settraitornr:addParam{ type=ULib.cmds.PlayerArg } settraitornr:help( "Force traitor next round." ) print("TTT Tools has finished loading")