• My custom killer revealer interfering with playerdeath hook??
    5 replies, posted
I paid someone to have this coded for me, but whenever I add it, if you commit suicide or get slayed you can talk to alive people in chat... It's attached to an "rdm box" that I also had coded for me... The coder is gone for a week on vacation, so could someone help me please? [lua]function DeathReporter( victim, weapon, killer ) if killer:IsPlayer() then victim:ConCommand("RDM_Box") if IsValid( victim ) && IsValid( killer ) then victim:SetNWString("Killer", tostring(killer:Nick())) victim:SetNWString("KillerRole", tostring(killer:GetRole())) if string.match(tostring(killer:GetActiveWeapon():GetClass()),"weapon_zm_") then victim:SetNWString("KillerWeapon", string.gsub(tostring(killer:GetActiveWeapon():GetClass()),"weapon_zm_","")) elseif string.match(tostring(killer:GetActiveWeapon():GetClass()),"weapon_ttt_") then victim:SetNWString("KillerWeapon", string.gsub(tostring(killer:GetActiveWeapon():GetClass()),"weapon_ttt_","")) end victim:SetNWInt("ShowReport", 1) timer.Simple(6, function() if IsValid(victim) then victim:SetNWInt("ShowReport", 0) end end) end end end hook.Add( "PlayerDeath", "DeathReporter", DeathReporter )[/lua]
There must be some other underlying issue. This wouldn't interfere with players talking on death. Make sure you have sv_allchat off and TTT all chat off. Can you paste the full code, including the RDM_Box concommand and the other part of PlayerDeath ( original function and other hooks ) if the allchat wasn't your issue.
Rdm box [lua]function RDMBox() frame = vgui.Create( "DFrame" ) frame:SetPos( ScrW() - 240, ScrH() - 150 ) -- Set the position for the menu to pop up at frame:SetSize( 220, 140 ) -- Make the second number bigger for a longer list, only if your a dev whos adding more skills. frame:SetTitle( "RDM Logger" ) -- Title of the main panel frame:SetDraggable( false ) frame:ShowCloseButton( true ) frame:MakePopup() timer.Simple(15, function() if frame:IsValid() then frame:Close() end end) PropertySheet = vgui.Create( "DPropertySheet", frame ) PropertySheet:SetPos( 10, 30 ) PropertySheet:SetSize( 200, 100 )-- Width and Height, Make the second number bigger, but make sure its always 38 less than the one above SheetItemOne = vgui.Create("DCollapsibleCategory", DermaPanel) SheetItemOne:SetPos( -100,-100 ) SheetItemOne:SetSize( 200, 500 ) SheetItemOne:SetExpanded( 1 ) -- Expanded when popped up SheetItemOne:SetLabel( "" ) SheetItemOne.Paint = function() -- The paint function surface.SetDrawColor( 50, 50, 200, 255 ) -- What color ( R, B, G, A ) end CategoryList = vgui.Create( "DPanelList" ) CategoryList:SetAutoSize( true ) CategoryList:SetSpacing( 5 ) CategoryList:EnableHorizontal( false ) CategoryList:EnableVerticalScrollbar( true ) SheetItemOne:SetContents( CategoryList ) -- Add our List above us as the contents of the collapsible category CategoryContentOne = vgui.Create( "DButton" ) CategoryContentOne:SetText( "Yes" ) CategoryContentOne.DoClick = function() surface.PlaySound( "ui/buttonclickrelease.wav" ) RunConsoleCommand("say", "@I was RDM'd by " ..tostring(LocalPlayer():GetNWInt("Killer"))) frame:Close() end CategoryList:AddItem( CategoryContentOne ) CategoryContentOne2 = vgui.Create( "DButton" ) CategoryContentOne2:SetText( "No" ) CategoryContentOne2.DoClick = function() surface.PlaySound( "ui/buttonclickrelease.wav" ) frame:Close() end CategoryList:AddItem( CategoryContentOne2 ) PropertySheet:AddSheet(" Were you RDM'd? ", SheetItemOne, false, false, "Skill Menu") end concommand.Add( "RDM_Box", RDMBox )[/lua] Here's the GUI of the first coded posted [lua]surface.CreateFont( "HUD_SmoothLarge", { font = "Coolvetica", size = 80 } ) surface.CreateFont( "HUD_Smooth", { font = "Coolvetica", size = 40 } ) surface.CreateFont( "HUD_SmoothMed", { font = "Coolvetica", size = 30 } ) surface.CreateFont( "HUD_SmoothMed2", { font = "Coolvetica", size = 34 } ) surface.CreateFont( "HUD_SmoothSmall", { font = "Coolvetica", size = 18 } ) surface.CreateFont( "HUD_Tahoma", { font = "Tahoma", size = 18 } ) surface.CreateFont( "HUD_TahomaMed", { font = "Tahoma", size = 22 } ) surface.CreateFont( "HUD_TahomaMed2", { font = "Tahoma", size = 26 } ) surface.CreateFont( "HUD_TahomaLarge", { font = "Tahoma", size = 30 } ) surface.CreateFont( "HUD_TahomaLarge2", { font = "Tahoma", size = 40 } ) surface.CreateFont( "HUD_TahomaLarger", { font = "Tahoma", size = 50 } ) surface.CreateFont( "HUD_Terminal", { font = "FixedSys", size = 40 } ) surface.CreateFont( "HUD_TerminalLarge", { font = "FixedSys", size = 50 } ) function DeathGUI( ply ) local client = LocalPlayer() killer = client:GetNWString("Killer") role = client:GetNWString("KillerRole") weapon = client:GetNWString("KillerWeapon") if client:GetNWInt("ShowReport") == 1 then draw.RoundedBox( 0,ScrW()/2 - 250,ScrH() - 350,500,250, Color( 35,35,140,255)) draw.RoundedBox( 0,ScrW()/2 - 250,ScrH() - 350,500,85, Color( 45,45,150,255)) surface.SetDrawColor(0,0,0,255) surface.DrawOutlinedRect(ScrW()/2 - 250,ScrH() - 350,500,250) draw.SimpleTextOutlined( "You were killed by.." , "HUD_TahomaLarger",ScrW()/2 - 15, ScrH() - 310, Color( 175,175,200,255 ), 1, 1,1, Color( 0,0,0,255 )) if role == "0" then draw.SimpleTextOutlined( killer .. " (Innocent)" , "HUD_TahomaLarge",ScrW()/2, ScrH() - 265, Color( 175,255,175,255 ), 1, 1,1, Color( 0,0,0,255 )) elseif role == "1" then draw.SimpleTextOutlined( killer .. " (Traitor)" , "HUD_TahomaLarge",ScrW()/2, ScrH() - 265, Color( 255,175,175,255 ), 1, 1,1, Color( 0,0,0,255 )) elseif role == "2" then draw.SimpleTextOutlined( killer .. " (Detective)" , "HUD_TahomaLarge",ScrW()/2, ScrH() - 265, Color( 175,175,255,255 ), 1, 1,1, Color( 0,0,0,255 )) end draw.SimpleTextOutlined( "With a..." , "HUD_TahomaLarger",ScrW()/2, ScrH() - 200, Color( 175,175,200,255 ), 1, 1,1, Color( 0,0,0,255 )) draw.SimpleTextOutlined( weapon , "HUD_TahomaLarge",ScrW()/2, ScrH() - 150, Color( 175,175,200,255 ), 1, 1,1, Color( 0,0,0,255 )) end end hook.Add("HUDPaint", "DeathGUI", DeathGUI)[/lua]
Did you check the all chat? That concommand is clear, nothing in it to cause your issue. It's either in function GM:PlayerDeath, another PlayerDeath hook, or all chat of some sort is enabled via TTT, Garry's Mod, or ULX/Admin mod. What admin mod are you using? Did you check the all chat variables? ( Easiest way to find them is type find xxx in console where xxx is what you're looking for, something like sv_allchat, or all_chat, etc... )
[QUOTE=Acecool;41867895]Did you check the all chat? That concommand is clear, nothing in it to cause your issue. It's either in function GM:PlayerDeath, another PlayerDeath hook, or all chat of some sort is enabled via TTT, Garry's Mod, or ULX/Admin mod. What admin mod are you using? Did you check the all chat variables? ( Easiest way to find them is type find xxx in console where xxx is what you're looking for, something like sv_allchat, or all_chat, etc... )[/QUOTE] I'm using ULX, but where is sv_allchat and all_chat located, how do I know if it's on or off? Edit: When I type "Find sv_alltalk" it says this in console [code]] find alltalk "rep_sv_alltalk" = "1" ( def. "" ) server_can_execute clientcmd_can_execute "sv_alltalk" = "0" game notify - Players can hear all other players, no team restrictions[/code]
I just found another thread which pointed out that the problem could be from ULX. ULX uses the PlayerDeath function / hook, and if it errors, then it will prevent other PlayerDeath hooks from being run properly. Can you post your servers console logs? They'd give a clue as to why it's not working.
Sorry, you need to Log In to post a reply to this thread.