spaghetti1337 Posted September 3, 2021 Share Posted September 3, 2021 Why I can't add items from "myVehicles" table? If I do outputChatBox then works like a charm, but the gridlist shows nothing. myVehicles = {} for key, value in ipairs(getElementsByType("vehicle")) do if getElementData(value, "veh >> owner") == getElementData(localPlayer, "acc >> id") then table.insert(myVehicles, value) end end for key, value in ipairs(myVehicles) do outputChatBox(getElementData(value, "veh >> id")) --- I have 6 vehicles and displays all of them in the chat gridlist:AddItem(1, getElementData(value, "veh >> id")) --- shows nothing in the gridlist I also tried with tonumber(getElementData(value, "veh >> id")) end if I just change the gridlist:AddItem(1, getElementData(value, "veh >> id")) to gridlist:AddItem(1, "test") then displays 6 "test" in the gridlist so the table works fine but can't get the veh id inside the gridlist Link to comment
spaghetti1337 Posted September 3, 2021 Author Share Posted September 3, 2021 Fixed it by adding tostring(getElementData(value, "veh >> id")) weird thing that the debugscript didn't show that before, just after a lot of try... Link to comment
Administrators Tut Posted September 3, 2021 Administrators Share Posted September 3, 2021 Closing this as requested Link to comment
Recommended Posts