Thanks , I need to replace in essential mode ?
Nope, you need to add function in you own code. Do not touch to essential mod and again in your code you have to replace the âGetplayersFromidâ exemple :
AddEventHandler('mod:event', function()
TriggerEvent('es:getPlayerFromId', source, function(user)
local player = user.identifier
--your code
end)
end)
by
AddEventHandler('mod:event', function()
local player = getPlayerID(source)
--your code
end)
For some reason you must keep it if you call the add/remove money cause itâs a part of essentialmode.
But itâs not an issue of Mysql Async Library, itâs just an issues in your code.
i can not figure out where this problem is located in the code.
I need some help, I am clearly not understanding something. I have followed the instructions on how to install the async libary but every time i replace ârequire âresources/essentialmode/lib/MySQLââ with ârequire âresources/mysql-async/lib/MySQLââ it comes up with these errors on every single script i have and they dont work.
Then i asked Vodkhard (He made a inventory system) why and he said not all scripts need that only the ones that require Async but when i then do that and change the scripts that originally require âresources/essentialmode/lib/MySQLâ" back to that. they dont work.
Please help this is bugging my mind.
Your Issue with your code is somewhere in server.lua for the resource whitelistdb and its either on or begins at line 5
By the looks of it your issue is because the Async Library opens a connection to the table differently compared to the original MySQL library that came with essential mode. Hope this helps
Not having enough time ATM to look at the table:open problem, but certainly other libs where depending on the connection provided by essentialmod which is not publicly available anymore (or at least not in the same manner), will look at this mode later (cannot give you an ETA, just when i got time )
By the way for those wondering, iâm already working on fxserver to have this lib working, right now itâs working for the async functions, and trying to convert sync function using async api with coroutines, but no success ATM.
I will try to push a new version with fxserver and legacy server compatible scripts
(Donât worry API should not change with 0.2.2)
Why what? Change the time it auto kills in the clean/clear script.
Remove mysql-async from your plugin if you donât want to auto kill connections that are sleeping for more than 10 secs, it doesnât do anything beside that when you add this mod in the list.
As this is a lib not a mod, and so you donât need to add it to your citmp-server.yml file just require the file that your need to make mysql requests.
i forgot to add one line. thanks
So iâve been trying to wrap my head around this all day, i have pretty good knowledge of mySQL, but im pretty new to lua.
i pretty much understand all the examples, but i donât understand how youâd go about changing something like this⊠https://pastebin.com/nFLNKUqJ
If someone would be kind enough to show me how/what to do it would be greatly appreciated.
how would I get the row count from a query?
need some help can anybody have the essential mode on async I been trying to convert and having problemsâŠ
Hello, Iâm having some issue with async request, iâm trying to moove but i have much error,
here my old request :
function checkIsTow(identifier)
local query = MySQL:executeQuery("SELECT * FROM repairman WHERE identifier = '@identifier'", { ['@identifier'] = identifier})
local result = MySQL:getResults(query, {'rank'}, "identifier")
if(not result[1]) then
TriggerClientEvent('repairman:receiveIsTow', source, "inconnu")
else
TriggerClientEvent('repairman:receiveIsTow', source, result[1].rank)
end
end
here the new one (maybe i did some error):
function checkIsTow(identifier)
MySQL.Async.fetchAll("SELECT * FROM repairman WHERE identifier = @identifier", { ['@identifier'] = identifier}, function (result)
if(not result[1]) then
TriggerClientEvent('repairman:receiveIsTow', source, "inconnu")
else
TriggerClientEvent('repairman:receiveIsTow', source, result[1].rank)
end
end)
Hi,
Thanks for this resources but for all my resources the â@identifierâ will not replace ⊠You know why ?
can you show us your code where this is located please.
why do i get this error everytime i try to load a resource that uses mysql
So I canât use essential mode on my hosted server cause I canât install couchdb on it.
Am I supposed to use this alongside a 2.0 version of essential mode? I change all the scripts and stuff, upgrade them, make them require the lib but it doesnât do anything.