Apo Posted January 29, 2016 Posted January 29, 2016 (edited) hi , please help me for fixe error [2016-01-29 13:42:32] ERROR: interior-system\s_interior_admin.lua:6: bad argument #1 to 'pairs' (table expected, got boolean) please help me for exports folder house-interiors file house-interiors-inmap have interiors = { [1] = { 3, 975.26, -8.64, 1001.14, 90 , "test1"}, [2] = { 11, 501.84, -67.84, 998.75, 180 , "test2"}, [3] = { 5, 772.43, -5.19, 1000.72, 0 , "test3" }, [4] = { 2, 2517.2119140625, -1296.705078125, 1076.9359130859, 270, "test4" }, [5] = { 3, 965.16015625, -53.212890625, 1001.1245727539, 90, "test5" }, [6] = { 3, 834.61, 7.54, 1004.18, 90 , "test6" }, } function getInteriorsList() return interiors end folder interior-system file s_interior_admin have function getInteriorID( thePlayer, commandName ) local c = 0 local interior = getElementInterior( thePlayer ) local x, y, z = getElementPosition( thePlayer ) local interiors = exports["house-interiors"].getInteriorsList() for k, v in pairs( interiors ) do if interior == v[1] and getDistanceBetweenPoints3D( x, y, z, v[2], v[3], v[4] ) < 10 then outputChatBox( "Interior ID: " .. k, thePlayer ) c = c + 1 end end if c == 0 then outputChatBox( "Interior ID not found.", thePlayer ) end end addCommandHandler( "getinteriorid", getInteriorID ) Edited January 29, 2016 by Guest only god (الله) اشهد ان لا اله الا الله واشهد ان محمد رسول الله
tosfera Posted January 29, 2016 Posted January 29, 2016 Calling an exported function requires a : instead of . change local interiors = exports["house-interiors"].getInteriorsList() to local interiors = exports["house-interiors"]:getInteriorsList() If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Apo Posted January 29, 2016 Author Posted January 29, 2016 not work man i need get table interiors from function getInteriorsList for function getInteriorID only god (الله) اشهد ان لا اله الا الله واشهد ان محمد رسول الله
Apo Posted January 29, 2016 Author Posted January 29, 2016 No one can fix that code Guys??!! only god (الله) اشهد ان لا اله الا الله واشهد ان محمد رسول الله
NewbProgramming Posted January 29, 2016 Posted January 29, 2016 Bro. The other thread you made we told you: exports["house-interiors"].getInteriorsList() Is NOT returning a table. and tosfera is right, to call another resource's function you need the colon not period, like so: exports["house-interiors"]:getInteriorsList() Check to make sure getInteriorsList is being exported in the meta.xml of the house-interiors resource. Do not create another thread for the same problem please. You can Private Message me and I will help you with Lua questions. 10 / 10 Lua scripter. 8 / 10 MTA scripter. 10 / 10 C++ embedded Lua.
Apo Posted January 29, 2016 Author Posted January 29, 2016 no my meta.xml fix and no problem not work !!!!!! only god (الله) اشهد ان لا اله الا الله واشهد ان محمد رسول الله
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