Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

16 Decent

About savour

  • Rank

Recent Profile Visitors

422 profile views
  1. @arciCZ In that case remove the formFields and replace it with postData (convert the table to json)
  2. Well, in "embeds" you can embed more than one embed, so you have to put it on another table (table per embed) embeds = { { -- This is embed number 1 title = "Hi", description = " S6066 authored & committed", fields={ {name="1",value="2"}, {name="3",value="4"} }, footer = { text = "Woah! So cool! :smirk:", icon_url = "https://i.imgur.com/fKL31aD.jpg" } } }
  3. You can use "INNER JOIN" but you will need to practice it a little bit (columns with the same name will be prefixed with the table name)
  4. Someone told me that he had bugs retrieving the false values from a json table (makes the value nil, which results of removing it from the Lua table). I didn't really test that bug but it should be fine, you can make some work around if you encountered it, not fatal bugs at the end so you are good to go (still, columns or another table are easier)
  5. IIYAMA's answer is the ideal way to handle that, storing items in a separate table, or use add another columns to your existing table. you can still store a whole table at one cell by the way but maybe you will find it a little buggy. you can store the table in a cell as JSON (text) using toJSON(table), and when you retrieve it use fromJSON()
  6. When you poll the query, it returns a table including other tables, each one represents a row, like this: local dbQ = dbQuery(database, "SELECT * FROM `players` WHERE `serial` = ?", player_serial) local dbR = dbPoll(dbQ, -1) -- in this case you're only expecting one row so the player will be dbR[1] serial = dbR[1].serial name = dbR[1].name -- If you're dealing with multiple entries: local dbQ = dbQuery(database, "SELECT * FROM `players`") -- This will result: { {name = "player1", serial="serial1", ...}, {name = "player2", serial="serial2", ...}, -- and so on } About the
  7. It means that it will wait for the results from the database, then continue executing, however, if the function didn't receive any value from the query during the `timeout` it will return nil, then continue the execution. for SQLite, you shouldn't worry about that (since it is on the same server, you almost get an instant response) so an ideal value should be -1 (no timeout) if you are dealing with a well-made database and healthy queries. This function, dbExec, doesn't return any value related to the query, it just executes the query, so you don't need a dbFree. (also, dbFree is
  8. savour

    Discord Python

    Show me the error, and the area where it happens
  9. savour

    Discord Python

    Here you go https://gitlab.com/OwlGamingCommunity/mta-python-sdk
  10. In this case, you need to check to see if any of the two windows are visible, for example: showCursor(guiGetVisible(window1) or guiGetVisible(window2), true) -- or you can make it shorter with oop showCursor(window1.visible or window2.visible, true)
  11. It's totally expected, when you hide the gui at the first time, isCursorShowing will return false after, so when you execute the function again it will show the cursor, as simple as that: not true = false not false = true So, it you only want to hide it, why checking for its visibility showCursor(false, true)
  12. In the first case, the first argument is the player who typed the command, and it's up to you to call it whatever you want. in the second case the source gotta be defined in the parent event/function, also it refers for "which element (player) am i going to trigger this event for?" also, the source is most likely to be hidden, you will find what it refers to when you search about the parent event in the wiki (would be like "The source of this event is ...")
  13. The thing is, marker hits are triggered for a lot of elements (including other markers as well), not just players, so you have to specify that. local respawnMarker = createMarker(2, 0, 2.22, "cylinder", 1.0, 255, 100, 100, 100) function toSpawnIt(player) if source == respawnMarker and getElementType(player) == "player" then spawnPlayer(player, 10, 0, 5) end end addEventHandler("onMarkerHit", resourceRoot, toSpawnIt)
  14. Simple if would do it if getTrainTrack and type(getTrainTrack) == "function" then --... end You can also check if it does exist in the _G table (which contains all global functions provided by mta/Lua)
  15. savour

    "Zoom" camera

    I think Matrix:getForward() with processLineOfSight should do the purpose
  • Create New...