• Client doesn't receive table inside a table
    6 replies, posted
Hi, I don't know why but Clients doesn't receive a table inside a table whereas the server does. I've made a command to print the clients table and here is the thing: [CODE]1: customcheck = function: 0x247faed8 description = Go find a Wrench! faction: item = ent_quest_wrench name = Wrench neededmission = 0 onquestfinished = function: 0x247fac48 repeatable = false uniqueID = 1 [/CODE] and same with server: [CODE]1: customcheck = function: 0x247faed8 description = Go find a Wrench! faction: 1 = 12 2 = 13 3 = 14 4 = 15 5 = 16 6 = 17 7 = 18 8 = 19 9 = 20 10 = 21 item = ent_quest_wrench name = Wrench neededmission = 0 onquestfinished = function: 0x21f41ba8 repeatable = false uniqueID = 1 [/CODE] Here is the sh_config file to add things in the table : [CODE]function Quest_Add(name, faction, uniqueID, description, item ,repeatable, customcheck, onquestfinished, neededmission) Quests[uniqueID] = {name=name, faction=faction, uniqueID=uniqueID, description=description, item=item, repeatable=repeatable, customcheck = customcheck, onquestfinished = onquestfinished, neededmission= neededmission} end -- Quest_Add(name, faction, uniqueID, description, item, repeatable, customcheck, onquestfinished, neededmission) local Sith = {TEAM_ESCLAVE,TEAM_ACOLYTE, TEAM_GUERRIER, TEAM_RAVAGEUR, TEAM_MARAUDEUR, TEAM_INQUISITEUR, TEAM_SORCIER, TEAM_ASSASSIN, TEAM_SEIGNEUR, TEAM_SEIGNEURNOIR} local Jedi = {TEAM_INITIE, TEAM_PADAWAN, TEAM_CHEVALIER, TEAM_GARDIEN, TEAM_SENTINELLE, TEAM_CONSULAIRE, TEAM_ERUDIT, TEAM_OMBRE, TEAM_MAITRE, TEAM_GMAITRE} --SET FACTION TO -- function(ply) return true end -- IF NOT USED --SET THE CUSTOM CHECK TO TRUE IF NOT USED --ITEM HAS TO BE SET TO A VALID ENTITY OR THE VALID NPC! Quest_Add("Wrench", Sith, 1, "Go find a Wrench!","ent_quest_wrench" ,false, function(ply) return ply:GetNWString("usergroup") == "VIP" or ply:IsAdmin() or ply:IsSuperAdmin() end, function(ply) ply:Give("weapon_lightsaber") end, 0 )[/CODE] As you can see, it's the faction table which is not sent correctly and I don't know how to fix this.
Perhaps those TEAM_* definitions are only being set serverside?
I don't know ? If you could tell me how to fix it :p
[DEL]You cannot write a table with a function inside it so you can't network.[/DEL] As for fixing it, try inserting the names like: [code] local sith = {"Jedi","Twat"} --To check the teams do local name = team.GetName(ply:Team()) if table.HasValue(sith,name) then --etc [/code]
actually the functions "customcheck" and "onquestfinished" work. So I don't know what you are talking about. I'm saying that my problem is that the client doesn't receive the table "faction" inside the table "Quests"
[QUOTE=annilator3000;49824251]actually the functions "customcheck" and "onquestfinished" work. So I don't know what you are talking about. I'm saying that my problem is that the client doesn't receive the table "faction" inside the table "Quests"[/QUOTE] My apologies, I thought the function networked the table at first.
Pigsy's solution work ! Thanks.
Sorry, you need to Log In to post a reply to this thread.