Monsthers Posted November 22, 2015 Share Posted November 22, 2015 Hello, i have a housing for my server RPG. but needs a data base for save all, this housing has, car shop, boat shop and house shop. one scripter he told me without data base no work the script, I don't know create a data base, Somebody help me, Please, Only i lack this script for open my server . Please help me and Thank you! Error in debugscript [2015-11-21 19:05:45] ERROR: RPGhousing\rpghousing.lua:221: Database query failed: no such table: icon_data [2015-11-21 19:05:45] ERROR: RPGhousing\rpghousing.lua:222: bad argument #1 to 'ipairs' (table expected, got string) Line of error local iconsTable = executeSQLSelect("icon_data","houseid,status,x,y,z") for k,v in ipairs(iconsTable) do local id = v.houseid local status = v.status if string.find(id,"safe") then Link to comment
jingzhi Posted November 22, 2015 Share Posted November 22, 2015 Hello, i have a housing for my server RPG. but needs a data base for save all, this housing has, car shop, boat shop and house shop. one scripter he told me without data base no work the script, I don't know create a data base, Somebody help me, Please, Only i lack this script for open my server . Please help me and Thank you!Error in debugscript [2015-11-21 19:05:45] ERROR: RPGhousing\rpghousing.lua:221: Database query failed: no such table: icon_data [2015-11-21 19:05:45] ERROR: RPGhousing\rpghousing.lua:222: bad argument #1 to 'ipairs' (table expected, got string) Line of error local iconsTable = executeSQLSelect("icon_data","houseid,status,x,y,z") for k,v in ipairs(iconsTable) do local id = v.houseid local status = v.status if string.find(id,"safe") then Firstable, you should use executeSQLQuery instead Read and learn more : https://wiki.multitheftauto.com/wiki/Database Link to comment
Monsthers Posted November 22, 2015 Author Share Posted November 22, 2015 This is the tablet? local iconsTable = executeSQLSelect("icon_data","houseid,status,x,y,z") for k,v in ipairs(iconsTable) do local id = v.houseid local status = v.status if string.find(id,"safe") then local pickup = createPickup(v.x,v.y,v.z,3,1277,1000) buyIcons[pickup] = {pickup,status,id} createBlipAttachedTo(pickup,35,1,255,255,255,100,0,50 ) elseif string.find(id,"marine") then local pickup = createPickup(v.x,v.y,v.z,3,1277,1000) buyIcons[pickup] = {pickup,status,id} createBlipAttachedTo(pickup,9,1,255,255,255,100,0,50 ) elseif string.find(id,"vehicle_trader") then local pickup = createPickup(v.x,v.y,v.z,3,1274,1000) buyIcons[pickup] = {pickup,status,id} elseif string.find(id,"boat_trader") then local pickup = createPickup(v.x,v.y,v.z,3,1274,1000) buyIcons[pickup] = {pickup,status,id} elseif string.find(id,"bank") then 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