fivem-basics
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFiveM basics
FiveM基础
Best practices for FiveM — resources, manifest, client/server, events. Use this skill whenever you are dealing with FiveM code to obtain domain-specific knowledge.
FiveM最佳实践——资源、清单、客户端/服务器、事件。当你处理FiveM代码以获取领域特定知识时,请使用此技能。
When to use
使用场景
- User asks how FiveM resources or scripts work.
- Editing or creating ,
fxmanifest.lua, orclient_*.lua.server.lua - Questions about client/server, events, or exports.
- Need to look up natives or detailed docs → point to https://docs.fivem.net/natives/ and https://docs.fivem.net/docs/.
- 用户询问FiveM资源或脚本的工作原理。
- 编辑或创建、
fxmanifest.lua或client_*.lua文件。server.lua - 关于客户端/服务器、事件或导出的问题。
- 需要查阅原生函数或详细文档→指向https://docs.fivem.net/natives/和https://docs.fivem.net/docs/。
How to use
使用方法
Read individual rule files for detailed explanations and examples:
- rules/structure.md — Resource structure and organization: scope, client/server separation, logical grouping, naming conventions.
- rules/fxmanifest.md — Resource manifest (fxmanifest.lua): fx_version, game, client_scripts, server_script, files, dependencies.
- rules/client-server.md — Client vs server scripts, shared code, communication patterns.
- rules/events.md — Events in Lua: RegisterNetEvent, TriggerServerEvent, TriggerClientEvent, naming conventions, security.
- rules/exports.md — Defining and consuming exports between resources.
- rules/debugging.md — Server vs client (F8) logs; when to ask the user for F8 logs if there's no server-side error.
- rules/optimization.md — Lua/FiveM optimization: locals, loops, natives (PlayerPedId, vector distance), state bags, security, readability, folder structure.
- rules/reference-links.md — Official docs and natives reference.
阅读单个规则文件以获取详细说明和示例:
- rules/structure.md — 资源结构与组织:作用域、客户端/服务器分离、逻辑分组、命名规范。
- rules/fxmanifest.md — 资源清单(fxmanifest.lua):fx_version、game、client_scripts、server_script、files、依赖项。
- rules/client-server.md — 客户端与服务器脚本、共享代码、通信模式。
- rules/events.md — Lua中的事件:RegisterNetEvent、TriggerServerEvent、TriggerClientEvent、命名规范、安全性。
- rules/exports.md — 资源间导出的定义与使用。
- rules/debugging.md — 服务器与客户端(F8)日志;当没有服务器端错误时,何时向用户索要F8日志。
- rules/optimization.md — Lua/FiveM优化:局部变量、循环、原生函数(PlayerPedId、向量距离)、状态袋、安全性、可读性、文件夹结构。
- rules/reference-links.md — 官方文档与原生函数参考。