Visual Studio Code
حمّل Visual Studio Code وابدأ البرمجة بسهولة.
إضافة JRS Core لـ VS Code#
الإضافة تعطيك الـ API داخل المحرر: إكمال تلقائي وشرح عند الوقوف على الدالة وsnippets لكل export وحدث، وثيم JRS Dark، وأمر يفتح هذي الوثائق.
- حمّل الملف
jrs-core-vsc.vsix. - في VS Code افتح Extensions واضغط
...ثم Install from VSIX. - افتح أي ملف
.luaواكتبJRS.أوexports.jrs_core:أوjrs-وراح تطلع لك الاقتراحات.
إضافة JRS Core
إكمال تلقائي وشرح وsnippets وثيم JRS Dark.
Lua (sumneko)
IntelliSense للـ Lua.
Cfx Lua
IntelliSense لدوال ونيتفات Cfx.
Error Lens
يعرض الأخطاء والتحذيرات داخل السطر.
أول سكربت لك#
fxmanifest.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
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)