papsmurfer Posted November 29, 2009 Share Posted November 29, 2009 (edited) Hi I am new to scripting (who isn't right) but any way I was wondering if someone could take the time and throughly explain SQL scripting and how it works and the basics of saving, this can server two purposes, n00bs can be referred here and you guys won't have to repeats bits and parts of the same questions everyday and it will benifit the MTA community. So can someone really experianced please take the time to explain how it works and everything I know this is a huge favor to ask but if someone could do it I guarentee everyone will benifit from it thanks for your replys!!!! for example what do i use as a database???? Edited November 29, 2009 by Guest Link to comment
Luke_Ferrara Posted November 29, 2009 Share Posted November 29, 2009 This sounds like a pretty good idea, after all the reason why SA-MP is more popular than MTA because SA-MP has so many "for dummy" tutorials to walk you through everything and if MTA had stuff like that it would be 100 times better than SA-MP I mean the gameplay in MTA is better all around. I would take the time but I don't know much about SQL, sorry Link to comment
papsmurfer Posted November 29, 2009 Author Share Posted November 29, 2009 I agree 100% but there are some tutorials like RobHols (sorry if I misspelled it) that is very good but to beginners it's sort of confusing. I am just looking for an in-depth tutorial on saving positions, skins, money, weapons, car ownership, and other varibles you can use with SQL Link to comment
robhol Posted November 29, 2009 Share Posted November 29, 2009 Hi; just to break in a bit here: if there's anything in my tutorial that's "confusing", it'd be nice if you could tell me what it is, that way I can improve it. Also, the basics of the SQL language are often the same across different implementations, so you could look at any SQL tutorial (this, for example. This is meant for websites, but as I said, the language and basic principles are the same) and still be able to use it here. Link to comment
papsmurfer Posted November 29, 2009 Author Share Posted November 29, 2009 Hi; just to break in a bit here: if there's anything in my tutorial that's "confusing", it'd be nice if you could tell me what it is, that way I can improve it.Also, the basics of the SQL language are often the same across different implementations, so you could look at any SQL tutorial (this, for example. This is meant for websites, but as I said, the language and basic principles are the same) and still be able to use it here. Your tutorial is not confusing, reason I said that is becuase you expect the reader to have some knowledge when 80% of the time new users don't know anything and expect everything to be spoon fed to them, annoying I know but I am looking to boost the popularity of MTA and if that means I can scrap together a tutorial (with appropriate credits of course) that spoon feeds and gives them a feel of lua and basics of saving they can move on to bigger and better things and benifiting us all. We should stop helping individuals with problems a guy two days ago had and saying the same things you know what I mean? Link to comment
eAi Posted November 30, 2009 Share Posted November 30, 2009 Why not use account data? Learning SQL and Lua (and programming) all not going to make your life easy. Account data should do what you want. https://wiki.multitheftauto.com/wiki/SetAccountData Link to comment
papsmurfer Posted November 30, 2009 Author Share Posted November 30, 2009 Why not use account data? Learning SQL and Lua (and programming) all not going to make your life easy. Account data should do what you want.https://wiki.multitheftauto.com/wiki/SetAccountData yes but how can you use SetAccountData to save car you have purchased, the last position you were before you disconnected, or houses Link to comment
cokacola Posted November 30, 2009 Share Posted November 30, 2009 Why not use account data? Learning SQL and Lua (and programming) all not going to make your life easy. Account data should do what you want.https://wiki.multitheftauto.com/wiki/SetAccountData yes but how can you use SetAccountData to save car you have purchased, the last position you were before you disconnected, or houses Here is one, to save your position when you disconnect(i think setAccountData is only for logged in players) --Save player's position on disconnect --save pos function savePos(quittype) local x,y,z = getElementPosition(source) local account = getPlayerAccount(source) setAccountData(account, "player.posx", x) setAccountData(account, "player.posy", y) setAccountData(account, "player.posz", z) end addEventHandler("onPlayerQuit", getRootElement(), savePos) then you can load it with getAccountData when the player logs in, or re-joins. P.S. just a note i found about this on the wiki: NOTE: Editing account data while the server is running currently deletes the account. If it were me, i'd probably save it in an XML file, but I use mySQL and the mySQL plugin for MTA. Link to comment
subenji99 Posted November 30, 2009 Share Posted November 30, 2009 I'm 99% certain that note is referring to editing the file in a text editor, not using setAccountData. I've used account data several times and not lost any accounts. https://wiki.multitheftauto.com/wiki/Ser ... _functions There are several examples given in those SQL functions, and combined with the SQL Documentation, you should have no issues at all. It's how I learned to use MTA's SQLite. Link to comment
artse Posted February 20, 2011 Share Posted February 20, 2011 Here's a good SQL Tutorial you can use as a reference: http://www.1keydata.com/sql/sql.html Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now