JRS COREDocumentação
Primeiros passos

Work space

Set up your development environment

Visual Studio Code

Download Visual Studio Code to start coding with ease.

JRS Core VS Code extension#

The extension gives you the JRS Core API in the editor: autocomplete, hover documentation, snippets for every export and event, the JRS Dark colour theme and a command that opens these docs.

  1. Download jrs-core-vsc.vsix.
  2. In VS Code open Extensions, click ... then Install from VSIX.
  3. Open any .lua file and type JRS., exports.jrs_core: or jrs- to see suggestions.

Your first script#

fxmanifest.lua

lua
fx_version 'cerulean'
game 'rdr3'
rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.'
lua54 'yes'

server_script 'server.lua'

server.lua

lua
local JRS = exports.jrs_core:getCoreApi()

RegisterCommand('hello', function(source)
    local character = JRS.GetCharacter(source)
    if not character then return end
    JRS.NotifyRightTip(source, 'Hello ' .. character.firstname, 4000)
    JRS.AddMoney(source, 5)
end)
JRS Core · Framework RedM gratuito e de código aberto · feito pela JRS TEAM