Documented FiveM LUA SDK

Hey guys,

after I’ve started to develop some things for FiveM my first problem was to know all the available functions and which parameters they accept. Cause of this I’ve created a SDK, primary for IntelliJ IDEA (should also work in other IDEs). The native methods are exported from the official documentation and the other functions I’m adding by hand.

VirusScan: https://www.virustotal.com/en/url/f2368bd5c8322ec0bffd3e60a71c69f2584633a65faaf5caec1a106adc88993f/analysis/1497806606/

I hope that it helps someone, and if you have some improvements or want to add something, feel free to create a PR.

3 Likes

… but the client already includes citizen/scripting/lua/natives_universal.lua, which contains LuaDoc-style comments for all existing natives, with the added advantage of being built together with the client and not relying on someone else having to update it.

In addition, in places it is just plain wrong - pointer functions have multiple return values.

1 Like

Thanks, haven’t found this one.
But after a look inside it hasn’t LuaDoc - it has comments but no LuaDoc. But yes, I agree with you that a version that is developed together with the real code is better.

Your linked function has, related to the documentation, just one return value BOOL the Vector3 is in the parameter outPosition, if one is found.

Yeah but as you don’t have pointers in Lua, and outPosition is a pointer (notice the *), it is returned as return value by the function.

1 Like

Ok, I’m pretty new to LUA, thanks for the hint.
The next sentence is very subjective: For me this is, atm, the most complete, readable and helpful (IDE) documentation I’ve found. And the main benefit, for me, is that everyone that founds a bug or a missing function can add it - so it doesn’t rely just on me.

And the problem with the pointer parameters will be the next thing for the exporter - it should be not this complex to find all parameters with a * and put the type of them into the @return list.

Not for parameters in existing natives (Cfx natives such as LoadResourceFile do) as those aren’t parsed yet - can improve this? Modify the generator and submit a PR. Don’t reinvent the wheel.

1 Like

And the same applies to the official docs, but then it’s a benefit for everyone and not just people using your thing…

Ok, the main problem than is the missing cross-linking and documentation. I’ve found nowhere any hint for a SDK in the client folder and/or the generator file.
Not in the forum, wiki or on the website. :confused:
And the best documentation or SDK is worthless if it isn’t linked. :frowning:

How can I add this to IntelliJ?

1 Like

Hello, does anyone use PhpStorm for FiveM? How can I add Extension SDK?"

Hello, does anyone use PhpStorm for FiveM? How can I add Extension SDK?"