This is driving me insane, i need help with derma.

Whenever i test my gamemode offline, it works great. The menu actually pops up when i press E. But when my friend downloads it to his server it doesnt.

Spent the last hour trying to figure it out, please help.

snip from cashshop/init.lua

[lua]
function ENT:Use(activator,caller)
local plnum = activator:UniqueID()
datastream.StreamToClients(player.GetByID(plnum), “ShopMenu”, { [“table”] = GAMEMODE:GiveTable(ShopWeapons)})
end
[/lua]

snip from gamemode/cl_init.lua

[lua]
function ShopMenu( handle, id, encoded, decoded )
//not yet ready to pass the table
local DermaPanel = vgui.Create( “DFrame” )
DermaPanel:SetPos( (ScrW() / 2 )- 175, (ScrH() / 2)- 167 )
DermaPanel:SetSize( 291, 335 )
DermaPanel:SetTitle( “Cash Shop” )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true ) – Draggable by mouse?
DermaPanel:ShowCloseButton( true ) – Show the close button?
DermaPanel:MakePopup()

local PropertySheet = vgui.Create( "DPropertySheet", DermaPanel )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 281, 300 )
 
 /*--------------------------------------------	
 Panel 1
 --------------------------------------------*/	
local WeaponPanel = vgui.Create( "DPanelList", DermaPanel )
WeaponPanel:SetPos( 0, 0 )
WeaponPanel:SetSize( 281, 300 )
WeaponPanel:SetSpacing( 5 ) -- Spacing between items
WeaponPanel:EnableVerticalScrollbar( true ) -- Allow scrollbar if you exceed the Y axis
WeaponPanel:EnableHorizontal(true)
WeaponPanel.Paint = function() -- Paint function
	surface.SetDrawColor( 50, 50, 50, 100) -- Set our rect color below us; we do this so you can see items added to this panel
	surface.DrawRect( 0, 0, WeaponPanel:GetWide(), WeaponPanel:GetTall() ) -- Draw the rect
end

//just for testing derp
local Icon1 = vgui.Create( "SpawnIcon")
Icon1:SetModel("models/weapons/w_rif_m4a1.mdl")
Icon1:SetToolTip("M4 $300")
WeaponPanel:AddItem( Icon1 )

local Icon2 = vgui.Create( "SpawnIcon")
Icon2:SetModel("models/weapons/w_rif_m4a1.mdl")
Icon2:SetToolTip("M4 $300")
WeaponPanel:AddItem( Icon2 )

local Icon3 = vgui.Create( "SpawnIcon")
Icon3:SetModel("models/weapons/w_rif_m4a1.mdl")
Icon3:SetToolTip("M4 $300")
WeaponPanel:AddItem( Icon3 )

local Icon4 = vgui.Create( "SpawnIcon")
Icon4:SetModel("models/weapons/w_rif_m4a1.mdl")
Icon4:SetToolTip("M4 $300")
WeaponPanel:AddItem( Icon4 )

local Icon5 = vgui.Create( "SpawnIcon")
Icon5:SetModel("models/weapons/w_rif_m4a1.mdl")
Icon5:SetToolTip("M4 $300")
WeaponPanel:AddItem( Icon5 )

PropertySheet:AddSheet( "Weapons", WeaponPanel, "gui/silkicons/bomb", false, false, "Buy some guns" )

end

datastream.Hook( “ShopMenu”, ShopMenu );
[/lua]

Screenshot of it working

i dont even hear the little bleep when playing online

so god damn confused
here’s the svn for all the source

http://pirates-prototype.googlecode.com/svn/trunk/

[lua]
function ENT:Use(activator,caller)
– local plnum = activator:UniqueID() – you don’t need this, just use activator below…
datastream.StreamToClients( activator, “ShopMenu”, { [“table”] = GAMEMODE:GiveTable(ShopWeapons)})
end[/lua]

Errors from his server and client console would be nice, so we know what’s not working.

[editline]8th August 2011[/editline]

Just looked at your source, you’re not loading the datastream module, which is probably why it wont work. Add require( “datastream” ) to the top of ANY file where you use datastream.