Custom addon works on testserver but not on server? :(

Hello dear fp users,
im having a problem with i guess my server: i wrote a custom addon and it works on the testserver (hosted& same addons as the main serever) but if i put the addon on the main server it doesnt work like on the hosted test server :confused: also i fixed tauntshop on the testserver and works perfectly there but it doesnt work on the main server?,do you know why that is so? :confused:

mfg

/code is in the last reply

Show us the code

the code doesnt matter does it since its working on the testserver which is connected[kind of] to the main server :smiley:

The code does ALWAYS matter.

yes but the code is working.[we’re having a test server which is hosted at the same hoster & its having the exact same data like the main server and it works on that test one…] it just does not work on our main server for some reason :/?

if you’re going to come for help, don’t be an ass and try avoiding showing the code. I doubt anyone here wants to steal your “code”.



local function Menu()
  local DermaPanel = vgui.Create( "DFrame" )
  DermaPanel:SetPos( 50, 50 )
  DermaPanel:SetSize( 250, 200 )
  DermaPanel:SetTitle("")
  DermaPanel:SetVisible( true )
  DermaPanel:SetDraggable( true )
  DermaPanel:ShowCloseButton( false )
  DermaPanel:Center( true )
  DermaPanel:MakePopup()
  DermaPanel.Paint = function( self, w, h ) 
    draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 160 ) ) 
  end

  local DermaLabel = vgui.Create("DLabel", DermaPanel)
  DermaLabel:SetText("random text?")
  DermaLabel:SetContentAlignment(5) 
  DermaLabel:SetPos(27,20)
  DermaLabel:SetFont("Trebuchet18")
  DermaLabel:SizeToContents()
  DermaLabel:SetColor(Color(25,255,25,255))

   local DermaLabel2 = vgui.Create("DLabel", DermaPanel)
  DermaLabel2:SetText("V1")
  DermaLabel2:SetContentAlignment(7) 
  DermaLabel2:SetPos(50,5)
  DermaLabel2:SetFont("DebugFixed")
  DermaLabel2:SizeToContents()
  DermaLabel2:SetColor(Color(238,228,51,255))

    local DermaLabel3 = vgui.Create("DLabel", DermaPanel)
  DermaLabel3:SetText("aut.")
  DermaLabel3:SetContentAlignment(7) 
  DermaLabel3:SetPos(7,175)
  DermaLabel3:SetFont("DebugFixed")
  DermaLabel3:SizeToContents()
  DermaLabel3:SetColor(Color(238,228,51,255))

      local DermaLabel4 = vgui.Create("DLabel", DermaPanel)
  DermaLabel4:SetText("©")
  DermaLabel4:SetContentAlignment(7) 
  DermaLabel4:SetPos(160,175)
  DermaLabel4:SetFont("DebugFixed")
  DermaLabel4:SizeToContents()
  DermaLabel4:SetColor(Color(238,228,51,255))


  local DermaButton = vgui.Create( "DButton" )
  DermaButton:SetParent( DermaPanel ) -- unterkategorie vom "DFRAME"
  DermaButton:SetText( "Ja" )
  DermaButton:SetPos( 50, 50 )
  DermaButton:SetSize( 150, 50 )
  DermaButton.DoClick = function ()
    DermaPanel:Close()
    net.Start("OpenMenu")
    net.SendToServer()

     -- führt den Consolenbefehl aus 
  end
      DermaButton.Paint = function( self, w, h ) 
    draw.RoundedBox( 0, 0, 0, w, h, Color( 255, 255, 255, 180 ) ) 
  end

    local DermaButton2 = vgui.Create( "DButton" )
  DermaButton2:SetParent( DermaPanel ) -- unterkategorie vom "DFRAME"
  DermaButton2:SetText( "Nein" )
  DermaButton2:SetPos( 50, 115 )
  DermaButton2:SetSize( 150, 50 )
  DermaButton2.DoClick = function ()
    DermaPanel:Close()
  end
    DermaButton2.Paint = function( self, w, h ) 
    draw.RoundedBox( 0, 0, 0, w, h, Color( 255, 255, 255, 180 ) ) 
  end
end

  concommand.Add("doituser",function(ply, cmd, args)
    RunConsoleCommand("say","!prsp")
end )

concommand.Add("DeathMenu",function() 
  local rs = GetRoundState()
  if rs == ROUND_PREP then
    Menu()
  end
end)


this is the part which is not working on the main server [does not pop up on playerdeath] but it does on the test server. [this is in clientside folder]

Hummm, how are you calling the dialog

serverside: as i said it works on our test server[perfectly] but not on main server :confused:



util.AddNetworkString("Name")
util.AddNetworkString("OpenMenu")


net.Receive("Name", function (len, ply)
  respawn(ply, "!prsp", true)
end)

net.Receive("OpenMenu", function (len, ply)
  if !ply:Alive() then
    ply:ConCommand("doituser")
  end
end)

First check if the file actually gets initialized with a print.

at the first line? [on both files client & server] right? sorry still beginner in lua coding :slight_smile:

so on client:



print("clientside_prsp.loaded")


server:



print("serverside_prsp.loaded")


these 2 in each first line? :slight_smile:

I would do that in the last line.

alright ty just gonna put it in first & last line just to make sure ^^,gotta wait for the owner cuz i dont have ftp to the main server,gonna let you know when we did it …

You can add me on steam if you need help in Lua.

klar mach ich gerne :),danke fürs angebot :slight_smile:

It’s hard to tell what’s even supposed to happen because your code is unnecessarily back-and-forth between server and client, but it’s possible you have another addon on the server overriding your receiver. “OpenMenu” isn’t exactly a unique name, especially considering receiver names ignore case.

hmm i dont know i can try to make them unique, maybe its working on the test server because we dont like take everyday the data from the server and maybe the owner added another addon to the main server and like you said maybe thats overwriting then… gonna let you know when the owner got time lol… (gonna take a bit) xD

mfg