Apo Posted January 28, 2016 Share Posted January 28, 2016 Hi guys, please help for fix my error [2016-01-28 12:05:06] ERROR: interior-system\s_interior_admin.lua:362: bad argument #1 to 'pairs' (table expected, got nil) 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 ) Link to comment
NewbProgramming Posted January 28, 2016 Share Posted January 28, 2016 exports["house-interiors"].getInteriorsList() Is not returning a proper table. Link to comment
denny199 Posted January 28, 2016 Share Posted January 28, 2016 The error says it all, on line 362, the variable 'interiors' is nil, so not a table. What does local interiors = exports["house-interiors"].getInteriorsList() return? Link to comment
Apo Posted January 28, 2016 Author Share Posted January 28, 2016 thank you for all for help i can fix error 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