Ulysses
Ulysses Stuff => General Chat & Help and Support => Topic started by: LuaTenshi on January 15, 2013, 12:03:19 AM
-
Can some one make a good video tutorial about how to use databases to store values like money? (For both online and offline databases.)
-
Are you wanting to use the built in sv.db SQLite that is included in Gmod?
Or do you want something that you can tie into a website like MySQL?
-
Are you wanting to use the built in sv.db SQLite that is included in Gmod?
Or do you want something that you can tie into a website like MySQL?
Well I would like to use the sv.db, because all I really need to do is store money (scores), ...and I don't feel like I need an online scoreboard.
---
But it really depends on what is better, I need to store players scores, perks, and inventory items.
-
I'm not sure if this is new to GM13 or not (I've never seen it...)
but it certainly looks promising..
wiki.garrysmod.com/page/Classes/Player/GetPData
-
I was actually trying to do the same exact thing, I found this tutorial here: http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index69ca.html (http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index69ca.html)
and followed it, only changing some values like the name of the shop etc. but it wouldn't store the data, I'm wondering now if that's because the tutorial was for GM12.
There is also SetPData. My next question would be is, how do I create the "money" column? Would it auto create if I ran
player.GetByID( 1 ):SetPData( "money", 100 ) before trying to GetPData money?
-
Yes. You don't have to worry about setting anything up when using GetPData/SetPData. It will do all of the backend stuff for you.
-
Great, thanks for the info -- I could see this file getting a bit messy/overloaded? Is there some way to clean it out without deleting it completely?
Maybe that doesn't even matter?