esx-framework
npx skills add https://github.com/germanfndez/fiveai-skills --skill esx-framework
Agent 安装分布
Skill 文档
ESX Framework Development
Complete guide for developing with ESX Legacy Framework â the most trusted FiveM roleplay framework since 2017.
When to use
- Creating or editing ESX resources/scripts
- Working with player data (xPlayer, PlayerData)
- Implementing jobs, economy, inventory, or weapon systems
- Using ESX client/server functions, callbacks, or events
- Questions about ESX best practices and optimization
How to use
Read individual rule files for detailed explanations and examples:
-
rules/core-concepts.md â ESX architecture, PlayerData, xPlayer object, framework initialization
-
rules/client-functions.md â Client-side ESX functions, UI systems, player state management
-
rules/server-functions.md â Server-side functions, player retrieval, callbacks, triggers
-
rules/xplayer-methods.md â xPlayer object methods: money, items, weapons, inventory, jobs, metadata
-
rules/jobs-economy.md â Job system, salaries, accounts (money/bank), society management
-
rules/inventory-items.md â Inventory system, item management, usable items, weight calculations
-
rules/weapons-loadout.md â Weapon system, loadout, components, ammo, tints
-
rules/events-callbacks.md â ESX events, server callbacks, client callbacks, secure net events
-
rules/best-practices.md â ESX coding standards, optimization, security, naming conventions
-
rules/reference-links.md â Official ESX documentation links
Key principles
- Always check for nil â
if xPlayer then ... endbefore using xPlayer - Use ESX.GetPlayerFromId â Standard player retrieval:
local xPlayer = ESX.GetPlayerFromId(source) - Wait for player load â Check
ESX.IsPlayerLoaded()on client before accessing PlayerData - Never trust client â Validate all data server-side, use SecureNetEvent for client events
- Follow ESX patterns â Use ESX functions instead of reinventing (callbacks, notifications, etc.)
- Optimize loops â Cache player objects, avoid unnecessary GetPlayerFromId calls
- Use camelCase â Follow Lua naming:
myVariable,MyGlobalFunction,MY_CONSTANT - Minimal globals â Keep variables local unless they need global scope
- Use ox_lib for UI â Prefer ox_lib for menus, dialogs, notifications, progress bars instead of ESX UI