Hey guys, I use a meta table that stores Pdata to store money and other stuff on my server for all players.
I also have this stuff export to a text file, for safe keeping.
I want to be able to unpack this data, and then directly edit it. Is there any way to do this?
I know you can create a loop and then have it print or set all Pdata for connected players, because I use the player object entity to store the Pdata.
The problem is, you can only do that for connected players, because the rest of the object entities don't exist if they aren't on the server.
Is there any way to unpack a specific Pdata value for all players, and then list it all?
I'm doing this so I can manually edit people's Pdata if they aren't on the server.
[URL="http://sourceforge.net/projects/sqlitebrowser/"]SQLiteBrowser[/URL] works well for manually editing the data. P.s. the file that contains the table is called sv.db in the gmod folder.
You could also call a query...
[code]
local DB = sql.Query("SELECT * FROM YOUR_TABLE_NAME")
[/code]
and that should return DB as a table containing everything, if you want it in lua.
When I try to Print the table or values in the table, it just prints "false"
Is the table name the same as the name I set as the Pdata?
If an SQLite query returns false, it means you have an error. Retrieve it with sql.LastError()
Sorry, you need to Log In to post a reply to this thread.