so its seems like the functions in my other lua file are not being recognised in my init even thow they are included, i dont know why its driving me crazy.
[ERROR] lua/includes/extensions/net.lua:103: bad argument #1 to 'pairs' (table expected, got nil)
1. pairs - [C]:-1
2. WriteTable - lua/includes/extensions/net.lua:103
3. databaseSend - gamemodes/darkrp/gamemode/database/database.lua:68
4. databaseCheck - gamemodes/darkrp/gamemode/database/database.lua:62
5. unknown - gamemodes/darkrp/gamemode/init.lua:7
6. UniqueID - [C]:-1
7. echoToAdmins - addons/ulx/lua/ulx/log.lua:164
8. fn - addons/ulx/lua/ulx/log.lua:202
9. unknown - addons/ulib/lua/ulib/shared/hook.lua:109
AddCSLuaFile("database/cl_database.lua")
include("database/database.lua")
function GM:PlayerAuthed( ply, steamID, uniqueID )
print("player:" .. ply:Nick() .. ", has gotten authenticated.")
ply:databaseCheck()
end
function GM:PlayerDisconnected( ply )
ply:databaseDisconnect()
end
What is "database.lua"? If it was bought from GModStore contact the author.
function ply:databaseCheck()
self.database = {}
local f = self:databaseExists()
if f then
self:databaseRead()
else
self:databaseCreate()
end
self:databaseSend()
self:databaseNetworkedData()
end
function ply:databaseSend()
net.Start( "database" )
net.WriteTable( self:databaseGet() )
net.Send( self )
end
that is the part of the code form database.lua its the database for mu inventory system
try adding in the start of database.lua
local ply = FindMetaTable("Player")
@G😹nz😻 its already there
There is a total of 7 functions in that little code snippet you sent us, 6 of which we don't have the code for.
If you made it then you should know how to fix it(p sure u didn't make this). You're sending an empty database table to the client.
Sorry, you need to Log In to post a reply to this thread.