Search the Community
Showing results for tags 'insert'.
-
Este es el código que he hecho hasta ahora... AreaGuerra = { 1, 1577.6806640625, 663.0947265625, 180, 120, , 0, 0, 0, 1698.1025390625, 679.1884765625, 14.822175979614 } function tables1 () executeSQLQuery("CREATE TABLE IF NOT EXISTS Gang_truf (ID INTEGER, X REAL, Y REAL, W REAL, H REAL, Gang STRING, R, G, B, sX REAL, sY REAL, sZ REAL)") for i, tables in ipairs(AreaGuerra) do local ID, X, Y, W, H, Gang, R, G, B, sX, sY, sZ = tables[1], tables[2], tables[3], tables[4], tables[5], tables[6], tables[7], tables[8], tables[9], tables[10], tables[11], tables[12] executeSQLQuery("insert into Gang_truf(ID, X, Y, W, H, Gang, R, G, B, sX, sY, sZ) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", ID, X, Y, W, H, Gang, R, G, B, sX, sY, sZ) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), tables1)
- 2 replies
-
- myslq
- mysql_help
-
(and 3 more)
Tagged with:
-
I wanted to ask if there is a way to check what index the value in the table is for example, t = {} table.insert(t,"Hello") table.insert(t,"HELLO") table.insert(t,"HI") if index==1 and value=="HI" then -- false --do something elseif index==0 and value=="HELLO" then --false --do something elseif index==2 and value=="HI" then --true --do something else --etc. --do something end --If someone does not distinguish the index from the value then the index is for example [0,1,2,3 ...] and the value is an element for example print(t[1]) -------------> 'HELLO'
-
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...
-
I created a scoreboard script, and the playerlist working fine, but i dont know how to insert teams, and team players after the playerlist, like in the default scoreboard script.. :s Anyone can help me?
-
I created a scoreboard system, but when i make a team, the team does not show in scoreboard.. how can i add this after playerlist?
-
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.