Jump to content

Austrothalik

Members
  • Posts

    8
  • Joined

  • Last visited

Details

  • Location
    Brasil
  • Occupation
    Developer
  • Interests
    Scripting

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Austrothalik's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. i`m having some difficult do that, right now im haiving this error ERROR: blips/blips.lua:60: attempt to concatenate local 'v' (a table value) what im trying to do: function listTable(queryHandle) local db = dbConnect("sqlite","blips.db") local p = dbPoll(dbQuery(db, "SELECT id,icon,name FROM tabelaBlips"), -1); if (#p > 0) then for k,v in pairs(p) do outputChatBox(k.." = "..v); end end end addCommandHandler("listTable",listTable,false,false) can sameone help me?
  2. function listTable() local db = dbConnect("sqlite","blips.db") local p = dbPoll(dbQuery(db, "SELECT id,icon,name FROM tabelaBlips"), -1); if (#p > 0) then for k,v in pairs(p) do outputChatBox(k.." = "..v); end end end addCommandHandler("listTable",listTable,false,false) im doing this and i recive this message when i exec the command ERROR: blips/blips.lua:60: attempt to concatenate local 'v' (a table value)
  3. Oh ir course hahaha i forget to put It on a functin, sorry
  4. https://ibb.co/p08Pm7W o got this messages from the console when i start the resource
  5. Olá, eu preciso imprimir  o SELECT de um SQL no meu chat, ou a tabela toda mesmo (Imagino  que não existam VIEWS no SQLite). Tem como? estou  a  um tempo  tentando  e  não consegui.  https://ibb.co/VwYFtyn No banco esta assim  e no chat queria que aparecesse algo assim pro usuário https://www.imagemhost.com.br/image/wf2dq . Poderia me dar uma ajuda ou ideia? Fico no aguardo  Muito Obrigado.

  6. how i can show information from my SQLite table with outputChatBox? i'm creating blips and storing them, then when i do /showBlips i want show a list of my SQL Table. How i can to this? maybe with arrays? how in MTA?
  7. Hi, im new to .lua and scripting but i already work with sql and other languages I am creating a script and I need to store data in a database. Now I manually create a database in the database folder and create a resource to connect with that database that I created manually. That way when i give my resource to someone it does not work because the other user does not have the database created etc. Or he will need my database exclusive resource too. I would like to know how to use the mta default database (i already check the database wiki, i know they exist but i dont know how to use or call them), that way I would create the table there with <executeSQLCreateTable> and be able to make my resource work on other servers. My english and pessimo please be patient and help me. If you all help me to make this work creating a table, so i think i can manage with the rest --CREATE BLIP function CreateBlip(player,command,icon,name) local db = exports.db:getConnection() local x, y, z = getElementPosition(player) y = y + 5 dbExec(db, 'INSERT INTO blips (x, y, z, icon, name) VALUES (?,?,?,?,?)',x,y,z,icon,name) createBlip(x,y,z,icon) end addCommandHandler('createBlip', CreateBlip, false,false) --------------------------------------------------------------------------------------------------- samething like this maybe --CREATE TABLE ------------------------------------------------------------------ function createSQLOnStart () -- create our table, if it doesn't already exist executeSQLCreateTable ( "blips", "id INT, x INT, y INT, z INT, icon INT, name TEXT" ) end addEventHandler ( "onResourceStart", getResourceRootElement(),createSQLOnStart ) --CREATE BLIP function CreateBlip(player,command,icon,name) --ignore this line---local db = exports.db:getConnection() (i was using this to connect the database that i create) local x, y, z = getElementPosition(player) y = y + 5 dbExec(db, 'INSERT INTO blips (x, y, z, icon, name) VALUES (?,?,?,?,?)',x,y,z,icon,name) createBlip(x,y,z,icon) end addCommandHandler('createBlip', CreateBlip, false,false) --------------------------------------------------------------------------------------------------- if someone already has experience and is willing to help me with these basic doubts, please leave the disagreement below discord**
  8. How i van restart a resource by command in the addCommandHandler?
×
×
  • Create New...