Jump to content

Help [table expected, got nil]


Apo

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...