Franks# Posted August 26, 2017 Share Posted August 26, 2017 Hello there dear community, I we've been trying to fix my old turfing script for hours, and it won't work. I am talking about a typical RPG Turfing script. I turn the script on, and I spawn as an official gang and I try to turn it on with a command, everything goes well, but no turfs poop up, I guess I have to make them somehow can someone help me. I need answers fast, thanks. There also might be something wrong with this: Spoiler local query = executeSQLQuery("SELECT id, owner, x, y, w, h, r, g, b FROM `war`") if #query > 0 then for i,node in ipairs(query) do And this Spoiler addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for i,b in ipairs(turfs) do executeSQLQuery("INSERT INTO war VALUES (?, 'Nobody', ?, ?, ?, ?, 0, 255, 0)", i+17, b[1], b[2], b[3], b[4]) end stopResource(getThisResource()) end ) Link to comment
Moderators IIYAMA Posted August 26, 2017 Moderators Share Posted August 26, 2017 ID should be handled by the database, not by LUA. (unless you have special reason for that) And make sure you define the column names before inserting. Link to comment
Franks# Posted August 26, 2017 Author Share Posted August 26, 2017 1 hour ago, IIYAMA said: ID should be handled by the database, not by LUA. (unless you have special reason for that) And make sure you define the column names before inserting. Well I have no idea about Databases, could u help me a little more? Link to comment
Moderators IIYAMA Posted August 26, 2017 Moderators Share Posted August 26, 2017 https://www.w3schools.com/sql/sql_insert.asp Use Google first, it is 10000000000000000000000000000000x smarter than me. 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