• Error on printing table in net.receive
    5 replies, posted
Hi, I have an this error : Error: Trying to network unacceptable type (table) When i printing my table but however it's printing my table. Here is my code (init.lua of an ent) : [CODE]function ENT:Initialize() self:SetModel("models/cookeraddon/four.mdl") self:PhysicsInit( SOLID_VPHYSICS ) self:SetMoveType( MOVETYPE_VPHYSICS ) self:SetSolid( SOLID_VPHYSICS ) local phys = self:GetPhysicsObject() if (phys:IsValid()) then phys:Wake() end self:SetPos(self:GetPos() + Vector(0,0,30)) self.IsBaking = false self:SetNWInt("FinishBakeTime",0) self:SetNWInt("IsBaking",0) self:SetHealth(200) self:SetNWInt("IsMenuOpen",0) for k, v in pairs(CookerAddon.recipes) do local name = "add"..v.id net.Receive(name,function() SetGlobalString("ActiveRecipe",v.recipe) local recipe = GetGlobalString("ActiveRecipe") PrintTable(recipe) end) end end[/CODE] And tell me if you want to have the code of how it's called.
There's not much I can say without the clientside, but what I can say is that you're using net messages wrong. [editline]19th October 2016[/editline] You should probably read up on the documentation again [url]http://wiki.garrysmod.com/page/Net_Library_Usage[/url]
I called it in a derma panel : [CODE] yes.DoClick = function() local name = "add"..id net.Start(name) net.SendToServer() net.Start("closeDermaRecipes") net.SendToServer() frame:Close() end [/CODE]
[QUOTE=Yazrihm;51226858] When i printing my table but however it's printing my table.[/QUOTE] SetGlobalString SetGlobal[b]String[/b] [img]http://i.imgur.com/EiKuadh.png[/img] [img]http://i.imgur.com/zrYfEKV.png[/img] [QUOTE=Yazrihm;51226858]table[/QUOTE]
[QUOTE=Robotboy655;51226886]SetGlobalString SetGlobal[b]String[/b] [img]http://i.imgur.com/EiKuadh.png[/img] [img]http://i.imgur.com/zrYfEKV.png[/img][/QUOTE] I'm pretty stupid so how can i stock my table ? i need it in ENT:Touch and ENT:Think
[QUOTE=LegoGuy;51226870]You should probably read up on the documentation again [url]http://wiki.garrysmod.com/page/Net_Library_Usage[/url][/QUOTE]
Sorry, you need to Log In to post a reply to this thread.