Annas Posted May 24, 2016 Share Posted May 24, 2016 Hi all, This code select Line 1 Only from Table_Name(skinsShaders) , i need it to select all lines .. filename[1].shaderid As far as i know, the problem is here.. the [1] means select from line 1 only.. I tried to remove it filename.shaderid But it's not working.. The Code(Server Side): function downloadPlayerAlternatexx(p, _) local filename = exports.DENmysql:query("SELECT * FROM skinsShaders") theskinId = filename[1].shaderid if (#filename > 0 ) then fetchRemote("http://localhost/shadersqsdqs/"..filename[1].shaderid..".jpg", checkPlayerAlternateSkin) end end addCommandHandler("additsx", downloadPlayerAlternatexx) Please help me. Link to comment
Moderators IIYAMA Posted May 24, 2016 Moderators Share Posted May 24, 2016 for i=1, #filename do -- local theskinId = filename[i].shaderid outputDebugString(tostring(theskinId)) -- end ? https://www.lua.org/pil/4.3.4.html Link to comment
Annas Posted May 24, 2016 Author Share Posted May 24, 2016 for i=1, #filename do -- local theskinId = filename[i].shaderid outputDebugString(tostring(theskinId)) -- end ? https://www.lua.org/pil/4.3.4.html Not working, please help .. function downloadPlayerAlternatexx(p, _) local filename = exports.CSTmysql:query("SELECT * FROM skinsShaders") for i=1, #filename do local theskinId = filename[i].shaderid fetchRemote("http://localhost/shadersqsdqs/"..tostring(theskinId)..".jpg", checkPlayerAlternateSkin) end end addCommandHandler("additsx", downloadPlayerAlternatexx) Link to comment
Moderators IIYAMA Posted May 24, 2016 Moderators Share Posted May 24, 2016 I can't help you if everything is correct. You have to be more specific. AND DEBUG YOUR CODE MANUALLY LIKE I DID FOR YOU! outputDebugString(tostring(theskinId)) Link to comment
Annas Posted May 24, 2016 Author Share Posted May 24, 2016 Not working man! Attempt to concatenate local 'theskinId' (a nil value) Code: function downloadPlayerAlternatexx(p, _) local filename = exports.CSTmysql:query("SELECT * FROM skinsShaders") for i=1, #filename do local theskinId = filename[i].shaderid outputDebugString(tostring(theskinId)) fetchRemote("http://localhost/shadersqsdqs/"..theskinId..".jpg", checkPlayerAlternateSkin) end end addCommandHandler("additsx", downloadPlayerAlternatexx) Link to comment
Moderators IIYAMA Posted May 24, 2016 Moderators Share Posted May 24, 2016 outputDebugString("filename[i] = ".. tostring(filename[i])) if theskinId then fetchRemote("http://localhost/shadersqsdqs/"..theskinId..".jpg", checkPlayerAlternateSkin) end Link to comment
Annas Posted May 24, 2016 Author Share Posted May 24, 2016 Same reason.. Attempt to concatenate local 'theskinId' (a nil value) Code: function downloadPlayerAlternatexx(p, _) local filename = exports.DENmysql:query("SELECT * FROM skinsShaders") for i=1, #filename do local theskinId = filename[i].shaderid outputDebugString("filename[i] = ".. tostring(filename[i])) if theskinId then fetchRemote("http://localhost/shadersqsdqs/"..theskinId..".jpg", checkPlayerAlternateSkin) end end end addCommandHandler("additsx", downloadPlayerAlternatexx) Link to comment
Moderators IIYAMA Posted May 24, 2016 Moderators Share Posted May 24, 2016 You can't have the same reason, because of line 6. nil values are not allow to pass line 6. Pls restart everything correctly. You probably have some data in your db which doesn't have a valid shaderid. Which means you have saved some incomplete/corrupted data. Validate the file-locations in your db with: https://wiki.multitheftauto.com/wiki/FileExists Delete those that do not exist. 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