spoty Posted May 10, 2014 Posted May 10, 2014 hi there i wanne make a database for save driftpoints like best drift last drift and total drift but i realy dont know how to make a database an how to link it to my drift script please can someone explain me how to do this?
Castillo Posted May 10, 2014 Posted May 10, 2014 You could use SQLite/MySQL to store the drift points. Functions: executeSQLQuery -- SQLite only. Or: MySQL & SQLite: dbExec dbQuery dbPoll
spoty Posted May 10, 2014 Author Posted May 10, 2014 You could use SQLite/MySQL to store the drift points.Functions: executeSQLQuery -- SQLite only. Or: MySQL & SQLite: dbExec dbQuery dbPoll okay thnx and how can i use it exactly? to make it save in .lua or .xml?
Castillo Posted May 10, 2014 Posted May 10, 2014 XML is another thing, which can also be used to save the drift points. Few SQLite examples: Create table: executeSQLQuery ( "CREATE TABLE IF NOT EXISTS drift_points ( accountName TEXT, points INT )" ) Insert row to table: executeSQLQuery ( "INSERT INTO drift_points ( accountName, points ) VALUES ( ?, ? )", "Castillo", 500 ) Update row: executeSQLQuery ( "UPDATE drift_points SET points = ? WHERE accountName = ?", 600, "Castillo" )
spoty Posted May 10, 2014 Author Posted May 10, 2014 XML is another thing, which can also be used to save the drift points.SQLite example to create a table: executeSQLQuery ( "CREATE TABLE IF NOT EXISTS drift_points ( accountName TEXT, points INT )" ) okay i gues lua is easy way for it? but i have this error now [2014-05-10 20:32:39] Starting drift [2014-05-10 20:32:39] ERROR: Couldn't parse config Driftdatabase.lua in resource drift [2014-05-10 20:32:39] Failed to start resource item Driftdatabase.lua in drift [2014-05-10 20:32:39] start: Resource 'drift' start was requested (Failed to start resource item Driftdatabase.lua which is required)
Castillo Posted May 10, 2014 Posted May 10, 2014 If I'm correct, you are trying to load a script as a config file, which is wrong. Post your meta.xml.
spoty Posted May 10, 2014 Author Posted May 10, 2014 "NL|Spoty" version="1.0.0" type="script"/> i give it a try to test it on client side
Castillo Posted May 10, 2014 Posted May 10, 2014 You can't load a script file as a config file. What is the content of "Driftdatabase.lua"?
spoty Posted May 10, 2014 Author Posted May 10, 2014 thats the database i try to make for save the drift points but i pretty fail hard i runned it now as client side and it is working now only it dont save / load the points
Castillo Posted May 10, 2014 Posted May 10, 2014 But what do you mean by "database"? is it a SQL database file?
spoty Posted May 10, 2014 Author Posted May 10, 2014 But what do you mean by "database"? is it a SQL database file? yes and sorry if i look like a noob but i never have worked before with database's
Castillo Posted May 10, 2014 Posted May 10, 2014 Oh well, if you want to use a own database file, then you must use the dbExec, dbQuery and dbPoll functions. Check the wiki links for each, they all got examples.
spoty Posted May 10, 2014 Author Posted May 10, 2014 Oh well, if you want to use a own database file, then you must use the dbExec, dbQuery and dbPoll functions.Check the wiki links for each, they all got examples. okay i will wiki it and thnx for your help your a legit man for me
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