Skip to content

About

Lua types generation for natives used in FiveM/RedM.

Resources

Stars

9 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

102 Commits

Folders and files

Repository files navigation

rage-lua-natives

TypeScript Bun License Open Issues

Generates Lua type annotations for FiveM and RedM natives. To use the natives in your editor, install fivem-lls-addon, which ships the generated output as a Lua Language Server addon.

Each native becomes an annotated stub with its namespace, side (client/server), description, parameters, return types and a link to its documentation page:

---**`PLAYER` `client`**
---[Native Documentation](https://docs.fivem.net/natives/?_0xAFAF86043E5874E9)
---@param player integer
---@return boolean
function IsPlayerFlashingStarsAboutToDrop(player) end

Requirements

Usage

git clone https://github.com/overextended/rage-lua-natives.git
cd rage-lua-natives
bun install
bun start [native sets...]

Pass the native sets to generate. With none, gta and rdr3 are generated. cfx is always included.

bun start            # cfx + gta + rdr3
bun start gta        # cfx + gta
bun start rdr3       # cfx + rdr3

The natives are downloaded and written to natives/, one .lua file per namespace:

Set Folder Contents Source
cfx natives/CFX-NATIVE CitizenFX natives static.cfx.re
gta natives/GTAV GTA V natives (FiveM) static.cfx.re
rdr3 natives/RDR3 Red Dead Redemption 2 (RedM) VORPCORE/RDR3natives

Running a set again replaces its previous output.

GitHub Actions

Other repositories can generate the natives on a schedule with the reusable workflow, which replaces the generated sets in path and commits them:

on:
  workflow_dispatch:
  schedule:
    - cron: 0 0 * * SUN

jobs:
  natives:
    permissions:
      contents: write
    uses: overextended/rage-lua-natives/.github/workflows/generate.yml@main
    with:
      native-sets: gta rdr3
      path: library/natives
Input Default Description
native-sets gta Native sets to generate (cfx is always included)
path library/natives Where to write the sets in the calling repository
ref main Ref of this repository to generate with
commit true Commit and push, otherwise upload as a natives artifact
commit-message ci: generate native definitions Message of the commit

To push with something other than GITHUB_TOKEN, pass a token secret, or app-id and app-private-key secrets for a GitHub App.

Credits

About

Lua types generation for natives used in FiveM/RedM.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages