Closed galibmahin closed 1 year ago
same
Has to deal with System Messages. It uses the API and that is gone, does it stop it from working?
CreateThread(function() --[[ System Messages. ]]
while true do
PerformHttpRequest('https://api.prefech.dev/v1/fivem/jdlogs/systemMsg', function(code, res, headers)
if code == 200 then
local rv = json.decode(res)
if rv.item.id then
if os.time(os.date("!*t")) - tonumber(rv.item.date) < (7 * 24 * 60 * 60) then
if GetResourceKvpString('JD_logs:SystemMessage') ~= rv.item.message then
print('^1JD_logs System Message\n^1--------------------^0\n^2'..rv.item.title..'^0\n'..rv.item.message..'\n^1--------------------^0')
ServerFunc.CreateLog({ EmbedMessage = '**'..rv.item.title..'**\n'..rv.item.message, channel = 'system'})
end
end
SetResourceKvp("JD_logs:SystemMessageId", ''..rv.item.id..'')
SetResourceKvp("JD_logs:SystemMessage", ''..rv.item.message..'')
end
end
end, 'GET', nil, {
['Token'] = 'JD_logsV3',
['Last'] = GetResourceKvpString('JD_logs:SystemMessageId')
})
Wait(15 * 60 * 1000)
end
end)
YES
Comment it out and test, it should not affect anything
I have the same error how can i fix it?
Read above, comment out those lines and test and report back if it still works
I have same error, can any one fix that ?
Read above, comment out those lines and test and report back if it still works
Hi, in server main.lua already have all that comment but it not fix. it still show many SCRIPT ERROR. Many thanks
so if i would comment this function out would the logs and everything still work?
It looks like it causes errors but idk if it still works or not. I'll try to see if I can find a work around when I can work on it.
alr thanks
I know this might be off-topic but what happened to Prefech/JokeDevil all of a sudden they disappeared
Same error, any working fix for that?
I know this might be off-topic but what happened to Prefech/JokeDevil all of a sudden they disappeared
Not sure tbh, we have no information
Same error, any working fix for that?
The error isnt script breaking so don't worry for now, ill make a PR soon and it will hopefully be fixed
We did it that way and now we no longer get the error message and it is now working for us
CreateThread(function() --[[ System Messages. ]]
while true do
PerformHttpRequest('https://api.prefech.dev/v1/fivem/jdlogs/systemMsg', function(code, res, headers)
if code == 200 then
local rv = json.decode(res)
if rv and rv.item and rv.item.id then
if os.time(os.date("!*t")) - tonumber(rv.item.date) < (7 * 24 * 60 * 60) then
if GetResourceKvpString('JD_logs:SystemMessage') ~= rv.item.message then
print('^1JD_logs System Message\n^1--------------------^0\n^2'..rv.item.title..'^0\n'..rv.item.message..'\n^1--------------------^0')
ServerFunc.CreateLog({ EmbedMessage = '**'..rv.item.title..'**\n'..rv.item.message, channel = 'system'})
end
end
SetResourceKvp("JD_logs:SystemMessageId", tostring(rv.item.id))
SetResourceKvp("JD_logs:SystemMessage", tostring(rv.item.message))
end
end
end, 'GET', nil, {
['Token'] = 'JD_logsV3',
['Last'] = GetResourceKvpString('JD_logs:SystemMessageId')
})
Wait(15 * 60 * 1000)
end
end)
We did it that way and now we no longer get the error message and it is now working for us
CreateThread(function() --[[ System Messages. ]] while true do PerformHttpRequest('https://api.prefech.dev/v1/fivem/jdlogs/systemMsg', function(code, res, headers) if code == 200 then local rv = json.decode(res) if rv and rv.item and rv.item.id then if os.time(os.date("!*t")) - tonumber(rv.item.date) < (7 * 24 * 60 * 60) then if GetResourceKvpString('JD_logs:SystemMessage') ~= rv.item.message then print('^1JD_logs System Message\n^1--------------------^0\n^2'..rv.item.title..'^0\n'..rv.item.message..'\n^1--------------------^0') ServerFunc.CreateLog({ EmbedMessage = '**'..rv.item.title..'**\n'..rv.item.message, channel = 'system'}) end end SetResourceKvp("JD_logs:SystemMessageId", tostring(rv.item.id)) SetResourceKvp("JD_logs:SystemMessage", tostring(rv.item.message)) end end end, 'GET', nil, { ['Token'] = 'JD_logsV3', ['Last'] = GetResourceKvpString('JD_logs:SystemMessageId') }) Wait(15 * 60 * 1000) end end)
Thanks! Btw, do you have any fix for that?
[ script:JD_logsV3] SCRIPT ERROR: @JD_logsV3/server/main.lua:216: bad argument #2 to 'gsub' (string/function/table expected, got nil)
I tried something like that, will it work? if nil then return end
[ script:JD_logsV3] SCRIPT ERROR: @JD_logsV3/server/main.lua:216: bad argument #2 to 'gsub' (string/function/table expected, got nil)
you are missing a weapon name from clientTables.lua