[RELEASE] [ESX] Documents

Everytime i press press to give a document to a player or see my public ones my game freezes, how can i fix that?

1 Like

The document that i give to the people dont save for the people only save for me when sv restart

I am having the some problem. Did you find a solution?

ESX.RegisterServerCallback(‘esx_documents:getPlayerDocuments’, function(source, cb)

local playerId = source
local xPlayer = ESX.GetPlayerFromId(source)
local forms = {}
if xPlayer ~= nil then
MySQL.Async.fetchAll("SELECT * FROM user_documents WHERE owner = @owner", {['@owner'] = xPlayer.identifier}, function(result)

    if #result > 0 then

        for i=1, #result, 1 do

            local tmp_result = result[i]
            tmp_result.data = json.decode(result[i].data)

            table.insert(forms, tmp_result)
            --print(dump(tmp_result))
        end
        cb(forms)
	end
end)
end

end)

for the Xplayer this is a mistake in the console

thats work for new es_extended?

Same thing here, managed to fix it?

Renaming to esx_documents works

everything looks like its working great, can’t seem to save them for later, finish a form and submit, then go in to saved documents and see nothing. kashacters , onesync,? could those be causing the issue?

anyone else have a issue with them not saving.?

When I upload the sql in my database it says error use essentialmode?Any ideas?

I get the Received nil from newely created scale object. when trying to create a document does anyone have any idea how to fix this?

Same thing mate. Can’t seem to find a solution anywhere.
If anyone found a way to fix it please let me know

Found out a solution.

I’ve fixed the code in both server.lua and client.lua
Both problems (form not being saved & nil created etc) are fixed in there.

client.lua (9.5 KB) server.lua (5.2 KB)

To make sure that your documents are being saved correctly though, you have to open your database and make sure that in table user_documents the “owner” has the same length & datatype as the one you have in table users identifier.
My users identifier length was 48 while in user_documents it was 45 therefore the document was not being saved to the correct ID.

2 Likes

i’m getting this error

[ERROR] [MySQL] An error happens on MySQL for query “INSERT INTO user_documents (owner, data) VALUES (@owner, @data) {@owner=steam:11000011788a08e;@data={“signed”:true,“headerJobLabel”:“Ε.Λ.Α.Σ”,“headerSubtitle”:“Υπεύθυνη δήλωση πολίτη.”,“headerLastName”:“Capone”,“headerFirstName”:“Al”,“headerDateOfBirth”:“04-01-1991”,“headerJobGrade”:“Διοικητής”,“elements”:[{“label”:“ΠΕΡΙΕΧΟΜΕΝΟ ΔΗΛΩΣΗΣ”,“type”:“textarea”,“value”:“h”,“elementid”:”_m0"}],“headerTitle”:“ΥΠΕΥΘΥΝΗ ΔΗΛΩΣΗ”,“submittable”:true,“headerDateCreated”:“25/06/2020 13:26:41”}}": Incorrect string value: ‘\xCE\x95.\xCE\x9B…’ for column zap511170-2.user_documents.data at row 1

1 Like

How can I edit one line of the document to other typografy?

when i press enter to open a document it says this https://gyazo.com/22476b4cab5708ee92e07a1729030b3f

no it works but when i submit the document after that i cant press anything and i have to alt f4

You need to edit the code

So I had no issues installing or getting the menu to open and close properly but when I fill out the form I don’t see or have an option to show, sign, and give copy. Granted I tested this without another person. Don’t know if I have to have someone infront of me to give me those options

yea how ?? im new to all this

You need to edit every line what contain getPlayerID