• How much PData is too much PData?
    5 replies, posted
I searched around for a bit. Couldn't really find anything except for this one thread posted back in 2012 or something. Pretty much said that PData was very resourceful. I'm making a gamemode for a bit of fun and it seems I can't save the user's guns that they bought. I messed around with this for days thinking it might be a mistake I made. Though I can't see any errors. So just to be sure, I wanted to ask if the amount of PData I have saved to each user here is too much. My guess is it might not be saving the data because it runs through ALL of the PData variables and sets them every time the server shuts down or user disconnects. Maybe it can't run through all of it time? I don't know guys. I'm stuck here. :/ Sorry if this is one of those dumb questions. Here is the shared player meta-table-script-whatever that has all the code inside. [url]http://pastebin.com/NtQBP9Hy[/url]
Considering PData simple saves it into SQLite as a string, stuff like on line 87 [code] self:GetPData( gunToCheck..".SavedUnlocked" ) == 1 [/code] will always fail. You can't really have too much PData, considering it's all stored in SQLite, there's a limit, but you probably won't hit it. As for it being efficient, you can almost always create a better scheme than what PData uses. Whether it'll matter depends on what it is.
I recommend making your own SQLite tables
[QUOTE=bigdogmat;51983653]Considering PData simple saves it into SQLite as a string, stuff like on line 87 [code] self:GetPData( gunToCheck..".SavedUnlocked" ) == 1 [/code] will always fail. You can't really have too much PData, considering it's all stored in SQLite, there's a limit, but you probably won't hit it. As for it being efficient, you can almost always create a better scheme than what PData uses. Whether it'll matter depends on what it is.[/QUOTE] gunToCheck is a string. I did something similar later in the file, on line 168. So it's still valid. Thanks for the extra info though. Now I know its an issue on my behalf. :)
[QUOTE=bosnian_cyco;51983746]gunToCheck is a string. I did something similar later in the file, on line 168. So it's still valid. Thanks for the extra info though. Now I know its an issue on my behalf. :)[/QUOTE] That's not what I mean, PData saves the data you give it in string form, so [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/GetPData]Player:GetPData[/url] will always return a string. Because of that the comparison will always fail.
[QUOTE=bigdogmat;51983767]That's not what I mean, PData saves the data you give it in string form, so [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/GetPData]Player:GetPData[/url] will always return a string. Because of that the comparison will always fail.[/QUOTE] Facepalming right now. Didn't see that. Thank you so much lol. Sorry for the misinterpretation. Have a good one man. :)
Sorry, you need to Log In to post a reply to this thread.