Jump to content

bad argument #1 to 'pairs' (table expected got nil)


xTanKx

Recommended Posts

First Error:

bad argument #1 to 'pairs' (table expected got nil) 

Line of first Error:

for i, v in pairs ( WayPointLocs [ t ] ) do 

And here is the table WayPointLocs:

WayPointLocs = { 
    ['Jobs'] = {  
        -- Los Santos 
        { "LS - Criminal 1", 1625.33, -1509.2, 13.6 }, 
        { "LS - Criminal 2", 2141.6, -1733.16, 17.29 }, 
        { "LS - Mechanic", 2277.06, -2359.07, 13.58 }, 
        { "LS - Medic", 1178.47, -1327.87, 14.12 }, 
        { "LS - Police", 1545.88, -1681.27, 13.56 }, 
    }, 
     
     
    ['Locations'] = {  
        -- Los Santos 
        ['Los Santos'] = { 
            -- { "Name", x, y, z } 
            { "Ammunation", 1366.23, -1278.39, 13.6 }, 
            { "Bank", 914.4, -995.55, 38.19 }, 
            { "All Saints General Hospital", 1184.45, -1322.87, 13.57 }, 
            { "Jefferson Hospital", 2001, -1446.85, 13.56 }, 
            { "Transfender Modshop", 1041.3, -1032.18, 32.09 }, 
            { "Aircraft Modshop", 1937.03, -2302.26, 13.55 }, 
            { "Lowrider Modshop", 2644.5, -2020.54, 13.55 }, 
            { "Pay n' Spray", 1025.46, -1031.82, 32.02 }, 
            { "Pay n' Spray", 2077.75, -1831.17, 13.38 }, 
            { "Pay n' Spray", 1921.97, -2247.42, 13.55 }, 
            { "Sports Car Shop (Grotti)", 551.84, -1272.28, 17.3 }, 
            { "Ghetto Car Shop (Coutt And Schutz)", 551.84, -1272.28, 17.3 }, 
            { "Cycle Shop", 1802.8, -1914.98, 13.4 }, 
            { "Aircraft Shop", 1802.8, -1914.98, 13.4 }, 
        },  
        ['San Fierro'] = { 
            { "Wheel Arch Angels Modshop", -2712.92, 217.36, 4.25 }, 
            { "Transfender Modshop", -1936.02, 234.95, 34.31 }, 
            { "Pay n' Spray", -1904.97, 273.14, 41.05 }, 
            { "Sports Car Shop", -1972.91, 286.07, 35.17 }, 
            { "San Fierro Medical Center", -2661.14, 606.22, 13.86 }, 
        } 
    }, 
     
    ['Players'] = { }, 
    ['Custom'] = { }, 
} 

Second error:

attemp to index local 'f' (a number value) 

Line of second error:

guiGridListSetItemText ( source, row, 1, tostring ( f [ 1 ] ), false, false ) 

Link to comment

here you have more lines:

if ( t ~= "Players" ) then 
                    for i, v in pairs ( WayPointLocs [ t ] ) do 
                        local row = guiGridListAddRow ( source ) 
                        guiGridListSetItemText ( source, row, 1, tostring ( i ), true, true ) 
                        for k, f in pairs ( WayPointLocs [ t ] [ i ] ) do 
                            local row = guiGridListAddRow ( source ) 
                            guiGridListSetItemText ( source, row, 1, tostring ( f [ 1 ] ), false, false ) 
                            guiGridListSetItemData ( source, row, 1, f ) 
                        end 
                    end 

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...