[ALPHA] FS Freeroam 0.1.5 [FiveM-Scripts]

Yes i have deleted my tutorial, because couchdb don’t work for a lot of people, sorry :joy:

1 Like

where is the content ?

https://gyazo.com/7856daad3a2924efd279eccab8658197

Wich content do you search ?

Ah… That’s too baaaad ! xD

Is the this working with the current essentialsmode? cause trying to log in on my server and it’s hanging?

2 Likes

I have errors with the vehicle store, when I start my server, I can buy a car but with time no one can. This shows me an error: getplayerfromid. Can someone explain?

Hi !
I got a problem with vehicule shop. When I buy (any) vehicule, it doesn’t spawn, I stay in the menu with the vehicule, and in my console This appears.

It’s probably the db. Can you help me ?

EDIT : I find the problem, it’s because we needs to be connect at steam. I’m so stupid. Sorry ! :smiley:

TriggerEvent: Connection must be valid and open

You are using MySQL. This resource uses CouchDB. The issue though, restart your server and then it should be fine.

Yes, when I restart the server, it works but after a certain time of activity, it no longer works. I’m trying to get the original files and empty the cache, I’ll keep you updated

Make your keep-alive timeout on the MySQL server to be longer, but please update to CouchDB. Stop using MySQL, as future updates releases for this resource will break your (outdated) version

are all the stores supposed to work and be useable when i upload this to the server because they dont for some reason or did i do something wrong?

also the same thing as stated before i buy a car and it dosent appear and it spends the money but i get no car

I am having this same issue here is my server log when i buy the car. I do not see anything writing to the es_freeroam DB in CouchDB either. it is displaying 0 Bytes - https://i.gyazo.com/34fd2d01770c66598301e814af846dac.png

I do not understand how to use couchdb you have solutions to understand a can better?

I don’t know why switched to CouchDB, MySQL was working perfectly and now most of ressources are outdated, and will probably not be updated. Sad :frowning:

1 Like

Just trying to set this up on couchdb. Where do I place the credentials for the database in this and what is the syntax.

local port = 5984 – change this if needed

db = {}

function db.getUser(identifier, callback)
local qu = {selector = {[“identifier”] = identifier}}
PerformHttpRequest(“http://removedip:5984” … port … “/es_freeroam/_find”, function(err, rText, headers)
local t = json.decode(rText)

  if(t.docs[1])then
  	callback(t.docs[1])
  else
  	callback(false)
  end

end, “POST”, json.encode(qu), {[“Content-Type”] = ‘application/json’})
end

function db.updateUser(identifier, update, callback)
db.getUser(identifier, function(user)
for i in pairs(update)do
user[i] = update[i]
end

  PerformHttpRequest("http://127.0.0.1:" .. port .. "/es_freeroam/" .. user._id, function(err, rText, headers)
  	callback((err or true))
  end, "PUT", json.encode(user), {["Content-Type"] = 'application/json'})

end)
end

TriggerEvent(‘es:exposeDBFunctions’, function(DB)
db.createDocument = DB.createDocument
DB.createDatabase(“es_freeroam”, function()end)
end)

Only the vehicle shops work and the stripclub (check the fs_freeroam/stores folder)

and most importantly smoke on water :slight_smile:

1 Like

Essential-mode does the authorization for you. The database function is exposed through a proxy-like feature so fs_freeroam can call upon the database so it can interact with it.

1 Like

@DrSithis - Much appreciated.