[How-To] Run Scripts on Crack (Multi-threading)

Incorrect. Yes, at this time, as an implementation detail, it is the case that exports use an event to get the callback on first use, but other than that exports directly route to the target resource, allow returning data (and promises), and are obviously the right choice for unicast calls as opposed to an event which will route to just about anything as an extreme waste.

1 Like

Okay so if I understand correctly, proper usage of events over exports would be, a resource would trigger an event that multiple other resources need to handle, like an onDeath event being triggered so 5-6 other resources can handle it, and you would export a function that one resource needs to handle from multiple other resources calling it, like an addStatusValue function that 3-4 other resources would call. Also, exports are more useful for function calls as such, due to the export directly calling the function code, rather than triggering something expecting a listener?

I’m currently observing the changes and updates made for people who chose to go with C#. I haven’t properly looked into fiveM server, but I’m assuming that anything .net can be used, including SIMD-optimized functions available in .net? If that’s the case, that changes everything and C# would clearly be superior. Some loops can be “parallelized” if the same operation is done on multiple players for example.


Ok, I have to ask, because I can’t find shit in the cfx/lua, GLM, or fkkn anything repo’s…

Where the hell does string.strjoin come from? Or more specifically, as your use in ox_lib sent me down this rabbit hole, where the hell does string.tostringall() come from?

I’ve done some testing and can make some reasonable assumptions to how they work, but I can’t find source for them bloody anywhere!

Real confused why you’re posting this here – but fortunate for you I have this thread followed I guess.