Jump to content

Search the Community

Showing results for tags 'table.insert'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 2 results

  1. local table = { {"1", "2", "3", "4"}, } function asdasdsdasdd() table.insert(table,"5","6","7","8") end What wrong? No errors and warnings in debugscript 3...
  2. Hello again. I have problem with table.insert. I have vehicle shop that saves data to tables and tables to element data. Always when you buy new vehicle, it should add sub-table to main-table and fill sub-table with data that i want to save. I also have panel where you can control your vehicles. Instead of showing data, the gridlist shows only number 1 in first column. Part of my code: [Server] local data = getElementData(client, "wangcars.data") if not data then setElementData(client, "wangcars.data", {}) end local data = getElementData(client, "wangcars.data") local ids = #data + 1 local x, y, z = getElementPosition(wangvehicle[client]) local rx, ry, rz = getElementRotation(wangvehicle[client]) local t = {} table.insert(t, getVehicleName(wangvehicle[client])) table.insert(t, tonumber(id)) table.insert(t, tonumber(ids)) table.insert(t, tonumber(price)) table.insert(t, c1 .. ", " .. c2 .. ", " .. c3 .. ", " .. c4 .. ", " .. c5 .. ", " .. c6) table.insert(t, x .. ", " .. y .. ", " .. z .. ", " .. rx .. ", " .. ry .. ", " .. rz) table.insert(t, "indrive") table.insert(data, t) setElementData(client, "wangcars.data", data) [Client] function refreshlist() guiGridListClear(vlist) guiGridListAddColumn(vlist, "Vehicle name", 0.3) guiGridListAddColumn(vlist, "Sell price", 0.3) guiGridListAddColumn(vlist, "ID", 0.3) local table = getElementData(localPlayer, "wangcars.data") if not table then setElementData(localPlayer, "wangcars.data", {}) end for i=1, #table do local row = guiGridListAddRow(vlist) guiGridListSetItemText(vlist, row, 1, table[i][1], false, false) guiGridListSetItemText(vlist, row, 1, table[i][4], false, false) guiGridListSetItemText(vlist, row, 1, table[i][3], false, false) end end The values are tested and they're working fine. No errors in debugscript.
×
×
  • Create New...