Jump to content

[HELP] Client side table problem


Recommended Posts

Posted

Hello, I am trying to get cars from a table and output them as rows in a gui. The table "local vehicleTable = { }" is at the top of the code, but it still says that the ipairs thing expects a table but got nil... Any ideas?

Here is the code:

for key, value in ipairs(vehicleTable) do 
            local carID = getElementData(value, "WGRPG.carID") 
            local row = guiGridListAddRow(gVehs) 
            guiGridListSetItemText(gVehs, row, col, getVehicleName(value), false, false) 
            guiGridListSetItemText(gVehs, row, IDcolumn, tostring(carID), false, false) 
        end 

76561198066470453.png

SP37Ecj.jpg?2MTA:Rust Pre-Alpha Build v.0.3:SP37Ecj.jpg?2

https://forum.mtasa.com/viewtopic.php?f=114&t=97848

2Pac: ''Only God can judge me!''

Posted

[quote name=..:D&G:..]Doesn't work... it still says "table expected got nil"

check your vehicleTable. and post full code here.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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