Apo Posted January 28, 2016 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 ) only god (الله) اشهد ان لا اله الا الله واشهد ان محمد رسول الله
NewbProgramming Posted January 28, 2016 Posted January 28, 2016 exports["house-interiors"].getInteriorsList() Is not returning a proper table. 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.
denny199 Posted January 28, 2016 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? Sometimes I dream about cheese
Apo Posted January 28, 2016 Author Posted January 28, 2016 thank you for all for help i can fix error 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