I'm still working on my gamemode, and I want to implement a character creation/saving system into it.
So my question is: would this be possible with SQLite? I mean, it should be.
And if it's possible, how would I go about doing it?
Yeah its possible, but it is much better done with just saving it to file with util.TableToKeyValues. SQLlite isn't that good for saving multiple characters. Also, it is MUCH easier to just do it by saving to file.
[QUOTE=CmdrMatthew;26388464]Yeah its possible, but it is much better done with just saving it to file with util.TableToKeyValues. SQLlite isn't that good for saving multiple characters. Also, it is MUCH easier to just do it by saving to file.[/QUOTE]
I wouldn't do it that way. If you save that file localy than you could edit it yourself and potentially give yourself stuff you shouldn't have. You could save it on the server, but then you have a bunch of text files cluttering up a profiles folder.
Iirc, there was an SQLite module somewhere in the release section, or they could be built in, not sure, but it is definitely possible.
Why is that a bad thing, giving yourself things you shouldn't have? I think its a perk of running the server, getting to be able to do whatever the hell you want. Also you could do the same with SQLite, it just requires a little more work.
I mean non-admins could give them crap they shouldn't, if you save player specific information in their own folders.
Saving it to files would still store it on the server, not on the client. I think you misunderstood what he was trying to say Feihc. Also, SQLite is included in gmod by default; I think what you meant is the MySQL (OO) module.
However, I must disagree with CmdrMatthew; saving player information in a database has so many advantages over plain file saving, I am not even going to bother listing them.
Yeah my wording was weird. I meant if he DID save on the client the values could be messed with, but he could avoid that by saving it on the server, but raw text files for EVERY player that connects could get annoying.
Agreeing with a database. It probably also simplifies lots of things about changing player data and avoids loading every text file and changing stuff.
[QUOTE=iRzilla;26485141]Database/SQL is slower and more resource hogging then flat files.
The SQL has to be pharsed and then a whole database file is read and parsed. So much more.[/QUOTE]
Are you high or what? Why does almost every web application use relational databases then?
Not to mention that the "whole database file is read" argument is absolute bullshit. Learn how MyISAM / InnoDB / every other DB engine work.
Sorry, you need to Log In to post a reply to this thread.