Jump to content

framef318

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by framef318

  1. Logging into MTA requires using an account in Internal.db only, right?
  2. I have a doubt that if we login / register or something like getAccount / addAccount the Account information is required. Is it only from Internal.db? It can't be pulled from mysql. What do other people normally use Mysql to store? or just store userdata
  3. I still don't understand, does that mean I can use for in and fromJSON(data)? But it seems like I've done this before and it didn't produce any results.
  4. How many baht do you sell? I've added you as a friend on discord.
  5. Thank you very much. I'll try it out. local a, b = fromJSON(data) If I can't know how many values to return, what do I do with local a, b?
  6. I tried using the API instead of direct mysql connection but I ran into a problem where I couldn't retrieve the API response value. It said it was a string. I tried converting it using toJSON and fromJSON and it didn't work. function hangetdleApiResponse(data, info) local json = toJSON(data) local result = fromJSON(data) if result then for _, user in ipairs(result) do // ipairs(json) iprint("ID: " .. user.id) iprint("Username: " .. user.username) iprint("Email: " .. user.email) end else iprint("Error parsing JSON data") end end function getApiData() local url = 'http://127.0.0.1:8000/user/' sendOptions = { connectionAttempts = 3, connectTimeout = 5000, method = "GET", formFields = {}, } fetchRemote(url, sendOptions, function(data, info) hangetdleApiResponse(data, info) end) end data repose json [ { "id": 49, "username": "framef318", "email": "[email protected]" }, { "id": 50, "username": "framef3188", "email": "[email protected]" } ]
×
×
  • Create New...