I currently have an issue with a script server side. It seems that Citizen.CreateThread(…) is not launch.
The same script work well on my localhost server but once uploaded on our live server nothing happen.
EventHandlers work as expected, only the stuff with Citizen.CreateThread(…) don’t.
Do you know how I could debug that please ?
Thanks
Hi ShahZaM,
thanks for your time. There is nothing wrong there since other code, that are not in an other thread, works fine.
For example this work fine :
AddEventHandler("onResourceStart", function(name)
if name == GetCurrentResourceName() then
local now = os.date('*t')
print('server time is : '..now.hour..'H'..now.min)
end
end)
It is like a thread failed to be created but silently.
Please provide us with the full file as well as the resource tree, once again. Also what server artifacts are you using? Could you try the same piece of code in a completely new empty server. The only cause I see for this is as if your CPU is almost at the limit of creating threads so your OS doesn’t allow it, but again I highly doubt this XD
This issue occurs on a server hosted by nexus. I’m developper for a team that handle an RP server.
I took their script that do not work and I put it on my own localhost server, and it works well on it.
I found other server script on their server where a call to Citizen.CreateThread was made and I put some print into them : nothing.
So I created a new module where I only create a thread that print a log every 5 sec and same behaviour : on my localhost that works, on their server it does not ^^.
In order to close this issue : at the endevery things worked, the server logs were just not displayed.
I changed the print() by triggering a client event and I saw that all was fine.