fivemluafxmanifestbasicsresource
fxmanifest.lua Complete Guide — Every Field You Need to Know
March 22, 2026
2 min read
152 views
fxmanifest.lua คู่มือฉบับสมบูรณ์
ทุก FiveM resource ต้องมี fxmanifest.lua เป็น entry point หลัก ไฟล์นี้บอก FiveM ว่า resource ของคุณทำอะไร ต้องการอะไร และมีไฟล์อะไรบ้าง
Structure พื้นฐาน
fx_version 'cerulean' -- version ของ FiveM manifest format
game 'gta5' -- gta5 หรือ rdr3
author 'YourName'
description 'Resource description'
version '1.0.0'
Scripts
-- Server scripts
server_scripts {
'@oxmysql/lib/MySQL.lua', -- ใส่ @ = shared resource
'config.lua',
'server/*.lua'
}
-- Client scripts
client_scripts {
'config.lua',
'client/*.lua'
}
-- Shared scripts (โหลดทั้ง client และ server)
shared_scripts {
'@es_extended/imports.lua',
'config.lua'
}
Dependencies
dependencies {
'es_extended', -- ต้องให้ ESX start ก่อน
'oxmysql',
'/server:6116', -- ต้องการ server version นี้ขึ้นไป
'/onesync' -- ต้องการ OneSync เปิดอยู่
}
NUI (HTML Interface)
ui_page 'ui/index.html'
files {
'ui/index.html',
'ui/style.css',
'ui/app.js',
'ui/img/*.png' -- glob patterns รองรับ
}
Data Files
-- เพิ่ม handling data สำหรับ vehicle
data_file 'HANDLING_FILE' 'data/handling.meta'
data_file 'VEHICLE_METADATA_FILE' 'data/vehicles.meta'
data_file 'CARCOLS_FILE' 'data/carcols.meta'
Exports
-- ประกาศ exports ที่ resource อื่นเรียกได้
exports { 'GetPlayerData', 'IsPlayerAdmin' }
server_exports { 'GetAllPlayers', 'GetPlayerIdentifier' }
Lua54
lua54 'yes' -- เปิดใช้ Lua 5.4 (แนะนำ)
-- ได้ integer division (//), bitwise operators, to-be-closed variables
ตัวอย่างครบถ้วน
fx_version 'cerulean'
game 'gta5'
author 'M2Dev'
description 'Custom Job Script'
version '2.1.0'
lua54 'yes'
dependencies {
'es_extended',
'oxmysql'
}
shared_scripts {
'@es_extended/imports.lua',
'config.lua'
}
server_scripts {
'@oxmysql/lib/MySQL.lua',
'server/main.lua',
'server/callbacks.lua'
}
client_scripts {
'client/main.lua',
'client/ui.lua'
}
ui_page 'ui/index.html'
files {
'ui/index.html',
'ui/style.css',
'ui/app.js'
}
exports { 'IsOnDuty', 'GetJobData' }
Common Errors
| Error | สาเหตุ | วิธีแก้ |
|---|---|---|
Could not load resource |
path ผิด | ตรวจ glob pattern |
dependency not met |
resource ไม่ได้ start | ตรวจ server.cfg order |
script not found |
ไฟล์ไม่มีอยู่ | ตรวจ file path |
สรุป
fxmanifest.lua ที่ดีคือรากฐานของ resource ที่ดี เข้าใจทุก field แล้วคุณจะหลีกเลี่ยง error ที่พบบ่อยและ deploy script ได้อย่างมั่นใจ
Related Articles
Breaking: GTA Online อัพเดท "Money Fronts" — FiveM Server Owners ต้องทำอะไร?
Rockstar ปล่อย GTA Online อัพเดท Money Fronts มีผลกระทบต่อ FiveM servers บางส่วน นี่คือสิ่งที่ต้องทำทันทีหลังอัพเดท
Community Spotlight: Script และ Projects ที่น่าสนใจจาก FiveM Community
รวม scripts, tools และ projects ที่โดดเด่นจาก FiveM community ในช่วงที่ผ่านมา ตั้งแต่ free resources ถึง open-source projects
txAdmin อัพเดทใหม่ — Dashboard, Diagnostics และ Ban System ที่ดีขึ้น
txAdmin ซึ่งตอนนี้เป็นส่วนหนึ่งของ Cfx.re อย่างเป็นทางการ ได้รับการอัพเดทครั้งใหญ่ มี features ใหม่ที่ทำให้ Server Management ง่ายขึ้นมาก