JRS COREالوثائق
البدء

بيئة العمل

جهّز بيئة التطوير حقك

Visual Studio Code

حمّل Visual Studio Code وابدأ البرمجة بسهولة.

إضافة JRS Core لـ VS Code#

الإضافة تعطيك الـ API داخل المحرر: إكمال تلقائي وشرح عند الوقوف على الدالة وsnippets لكل export وحدث، وثيم JRS Dark، وأمر يفتح هذي الوثائق.

  1. حمّل الملف jrs-core-vsc.vsix.
  2. في VS Code افتح Extensions واضغط ... ثم Install from VSIX.
  3. افتح أي ملف .lua واكتب JRS. أو exports.jrs_core: أو jrs- وراح تطلع لك الاقتراحات.

أول سكربت لك#

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 · فريمورك RedM مجاني ومفتوح المصدر · من فريق JRS