Okay, wtf is happening, I cannot find this anywhere, I'm making something for someone, works fine for me, this is the code
[CODE]
hook.Add("PlayerButtonDown", "OpenDermaMenu", function(ply, key)
faction = faction or {}
if(key == 97) then
net.Start("ShowEveryone")
net.WriteTable(faction)
net.Send(ply)
return
end
if(key == 98) then
plyFaction = ply:GetFactions()
net.Start("FactionManager")
net.WriteTable(faction)
net.WriteTable(plyFaction)
net.Send(ply)
return
end
end)
function meta:GetFactions()
faction = faction or {}
local plytable = {}
for k,v in pairs(faction) do
for a,b in pairs(faction[k].usersid) do
if b == self:SteamID() then
table.insert(plytable, k);
end
end
end
return plytable;
end
[/CODE]
Error:
[CODE]
[ERROR] lua/includes/modules/net.lua:64: bad argument #1 to 'pairs' (table expected, got function)
1. pairs - [C]:-1
2. WriteTable - lua/includes/modules/net.lua:64
3. fn - addons/darkrpfactions/lua/sv_faction.lua:48
4. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
[/CODE]
line 48 = net.WriteTable(faction)
What is going on >.<
Works 100% for me, give it to him, this happens,
He is on Linux, I am on Windows...
[editline]18th April 2014[/editline]
Okay, apparently it works now, maybe he had some addon or something, he fixed it his end.
Sorry, you need to Log In to post a reply to this thread.