ox_core คืออะไร เหมาะกับ Server แบบไหน
ox_core คือ Modern FiveM Framework สำหรับจัดการระบบหลักของ Server โดยเฉพาะ Player, Character, Groups, Accounts, Vehicles และ Persistence ของข้อมูล
Project อธิบายตัวเองแบบตรงไปตรงมาว่าเป็น
A modern FiveM framework
และมีเป้าหมายหลักด้าน
Player Management
Character Management
Vehicle Management
Persistence
Groups
Accounts
Permissions
ดังนั้น ox_core อยู่ในกลุ่มเดียวกับ Framework อย่าง
ESX
QBCore
Qbox
ในแง่ที่สามารถเป็น Core กลางของ FiveM Server ได้
แต่ต้องแยกให้ออกว่า
ox_core
≠
ox_lib
≠
ox_inventory
≠
oxmysql
≠
ox_target
เพราะแต่ละ Resource มีหน้าที่ต่างกัน
① ox_core คืออะไรแบบง่ายที่สุด
ลองสมมติว่ากำลังสร้าง Serious RP Server
Server ต้องรู้ว่า Player คนหนึ่ง
เป็น User คนไหน
เล่น Character ไหน
อยู่ Group อะไร
มี Account ไหน
เป็นเจ้าของรถอะไร
มีสถานะอะไร
ข้อมูลต้อง Save อย่างไร
ox_core ทำหน้าที่เป็น Framework กลางสำหรับข้อมูลเหล่านี้
ภาพรวมประมาณ
FiveM
↓
ox_core
↓
Player / Character
↓
Groups / Accounts
↓
Vehicles
↓
Database
แล้ว Custom Resources สามารถเรียก API ของ Core เพื่อใช้ข้อมูลต่อได้
② ox_core เป็น Framework จริงหรือไม่
ใช่
นี่เป็นจุดที่ต้องแยกจาก OX Resource อื่นให้ชัด
ox_core
Framework
ox_lib
Library
oxmysql
Database Interface
ox_inventory
Inventory
ox_target
Interaction / Target
ดังนั้นการใช้ ox_lib ไม่ได้หมายความว่า Server ใช้ ox_core
③ ox_core ทำหน้าที่อะไร
หน้าที่สำคัญของ Core ปัจจุบันประกอบด้วยแนวคิด เช่น
Users
Characters
Players
Groups
Accounts
Vehicles
Licenses
Statuses
Permissions
Persistence
ตัว Framework จึงไม่ได้เป็นเพียง Player Object ตัวเดียว
แต่สร้าง Data Model สำหรับ RP Server หลายส่วน
④ User กับ Character แยกกันอย่างไร
Current ox_core Database แยก
users
ออกจาก
characters
แนวคิดคือ
User
↓
Character A
Character B
Character C
ตามจำนวน Character Slots ที่ Server กำหนด
นี่ช่วยแยก
ตัวผู้ใช้งานจริง
ออกจาก
ตัวละคร Roleplay
อย่างชัดเจน
⑤ users Table เก็บอะไร
Current Database Schema มี users Table สำหรับข้อมูลระดับ User เช่น
userId
username
license2
steam
fivem
discord
ตาม Identifier ที่มี
Primary Identity ในระบบนี้จึงไม่ได้ผูกทุกอย่างเข้ากับ Character Record เพียง Table เดียว
⑥ characters Table เก็บอะไร
Current characters Table มีข้อมูล Character เช่น
charId
userId
stateId
firstName
lastName
gender
dateOfBirth
phoneNumber
lastPlayed
isDead
position
health
armour
statuses
จึงเห็นได้ว่า ox_core มี Character Model ค่อนข้างชัดเจน
⑦ charId คืออะไร
charId คือ ID ภายในของ Character
ตัวอย่าง
User 15
↓
Character 72
Resources สามารถใช้ Character ID เพื่อเชื่อม Persistent Data เช่น
Accounts
Vehicles
Licenses
Groups
Inventory
ได้
⑧ stateId คืออะไร
Current Character Schema ยังมี
stateId
เป็น Unique Value สำหรับ Character
จึงสามารถใช้เป็น Character-facing Identifier ในระบบต่าง ๆ ได้ตาม Architecture
อย่าสับสนระหว่าง
userId
charId
stateId
source
เพราะแต่ละตัวมีหน้าที่ต่างกัน
⑨ source ต่างจาก Character ID อย่างไร
source คือ Player Server ID ใน Session ปัจจุบัน
เช่น
source = 25
ออกแล้วเข้าใหม่อาจเป็น
source = 91
แต่
charId
เป็น Persistent Character Identity
จึงไม่ควรใช้ source เป็น Database Identity ระยะยาว
⑩ ox_core มี Player Object หรือไม่
มีแนวคิด
OxPlayer
Current Server API สามารถหา Player ได้ด้วย
Ox.GetPlayer(playerId)
และยังมี Functions สำหรับค้นหาด้วย Character/User Identity
เช่นแนวคิด
Ox.GetPlayerFromCharId(charId)
หรือ
Ox.GetPlayerFromUserId(userId)
ทำให้ Custom Resources ไม่ต้องเขียน Player Registry ใหม่เอง
⑪ GetPlayer ใช้ทำอะไร
สมมติ Server Event
RegisterNetEvent('myjob:server:start', function()
local player = Ox.GetPlayer(source)
if not player then
return
end
end)
จากนั้นสามารถใช้ Player Object ตาม API ของ Framework
แนวคิดคือ
source
↓
OxPlayer
↓
Character Data
คล้าย Framework อื่นที่มี Player Object แต่ Syntax และ Data Model ต่างกัน
⑫ ox_core มีระบบ Groups หรือไม่
มี
Current API รองรับ
Ox.CreateGroup
Ox.GetGroup
Ox.GetGroupsByType
และ Group Data สามารถประกอบด้วย
name
label
grades
type
colour
hasAccount
จึงสามารถสร้างระบบองค์กรได้ เช่น
Police
EMS
Mechanic
Gang
Business
Government
⑬ Groups ใช้แทน Jobs ได้ไหม
ใน Architecture ของ ox_core Groups มีความยืดหยุ่นมากกว่าแนวคิด Job แบบตายตัว
ตัวอย่าง
Group Type = job
→ police
→ ambulance
Group Type = gang
→ ballas
Group Type = business
→ mechanic_company
Custom Resources สามารถใช้ Group Type เพื่อแบ่งประเภทองค์กรได้
⑭ Group Grade มีหรือไม่
มี
Current Database มี
ox_group_grades
และแต่ละ Group สามารถมี Grades หลายระดับ
ตัวอย่าง
police
├── Cadet
├── Officer
├── Sergeant
└── Chief
แต่ละ Grade ยังสามารถสัมพันธ์กับ Permissions หรือ Account Roles ได้ด้วย
⑮ Character สามารถอยู่หลาย Groups ได้หรือไม่
Database มี Table
character_groups
ซึ่งเชื่อม
charId
+
group
+
grade
+
isActive
ทำให้ Data Model รองรับ Character Groups ได้ยืดหยุ่น
เช่น Character หนึ่งอาจมีความสัมพันธ์กับหลายองค์กรตาม Design ของ Server
⑯ Active Group คืออะไร
Current Core มีแนวคิด Group ที่ Active
Resource สามารถใช้ข้อมูลนี้เพื่อกำหนด Context ปัจจุบัน เช่น
ตำรวจ
แต่ตอนนี้ไม่ได้ Active เป็นตำรวจ
หรือ
Character มีหลาย Groups
↓
เลือก Active Group ตาม Gameplay
ช่วยให้ระบบองค์กรซับซ้อนกว่าการมี Job String เดียวได้
⑰ ox_core มี Permission System หรือไม่
มี
Current Server APIs รองรับ Group Permissions
ตัวอย่างแนวคิด
Ox.SetGroupPermission(
'police',
1,
'handcuff',
'allow'
)
จากนั้น Player สามารถตรวจ Permission ตาม Group/Grade ได้
แนวคิดจึงเป็น
Group
↓
Grade
↓
Permission
↓
Gameplay Action
⑱ Permission ดีกว่าตรวจ Job Name อย่างเดียวอย่างไร
Script แบบง่ายอาจทำ
if player.job == 'police' then
แต่ Permission System ทำให้กำหนดละเอียดขึ้น
เช่น
police grade 0
→ view_armory
police grade 2
→ handcuff
police grade 4
→ manage_members
ทำให้ Resource ไม่จำเป็นต้อง Hardcode Grade Number ทุกจุด
⑲ ox_core มีระบบ Accounts หรือไม่
มี
Current Core มี
OxAccount
และ APIs เช่น
Ox.CreateAccount
Ox.GetAccount
Ox.GetCharacterAccount
Ox.GetGroupAccount
ดังนั้นระบบเงินไม่ได้จำกัดแค่
cash
bank
ใน Player Object เพียงอย่างเดียว
⑳ Character Account คืออะไร
Character สามารถมี Default Account
ตัวอย่าง
Character
↓
Personal Account
↓
Balance
Transactions
Current Database ยังมี Tables สำหรับ
accounts
accounts_access
accounts_transactions
account_roles
ทำให้ระบบบัญชีรองรับ Access Control และ Transaction History ได้
㉑ Group Account คืออะไร
Group สามารถมี Account ได้ด้วย
ตัวอย่าง
Police Department
↓
Group Account
หรือ
Mechanic Company
↓
Business Account
Current Group Data มี Field
hasAccount
และ Group Grades สามารถสัมพันธ์กับ Account Roles
จึงเหมาะกับระบบ Society/Business ที่ซับซ้อน
㉒ Account Roles มีอะไร
Current Database มี Roles อย่างแนวคิด
viewer
contributor
manager
owner
แต่ละ Role สามารถมีสิทธิ์ เช่น
deposit
withdraw
addUser
removeUser
manageUser
viewHistory
manageAccount
sendInvoice
payInvoice
ช่วยให้ Banking/Business Resources สามารถใช้ Permission Structure กลางได้
㉓ ox_core มี Transaction History หรือไม่
Current Schema มี
accounts_transactions
สำหรับเก็บข้อมูล Transaction เช่น
from
to
amount
message
note
balance
date
จึงสามารถนำไปสร้าง Banking UI หรือ Audit Trail ได้
โดยไม่ต้องออกแบบ Account Database ใหม่ตั้งแต่ศูนย์
㉔ ox_core มี Vehicle Management หรือไม่
มี และนี่เป็นหนึ่งในความสามารถเด่นของ Framework
Project อธิบายตัวเองว่าเน้น
Player and vehicle management and persistence
Current API มีแนวคิด
OxVehicle
และ Functions เช่น
Ox.CreateVehicle
Ox.GetVehicle
Ox.SpawnVehicle
Ox.GetVehicles
㉕ ox_core บันทึกรถใน Database หรือไม่
ได้
Current Vehicle Schema มีข้อมูล เช่น
id
plate
vin
owner
group
model
class
data
trunk
glovebox
stored
ดังนั้น Core สามารถจัดการ Owned Vehicles และ Vehicle Persistence ได้
㉖ VIN คืออะไรใน ox_core
Current Vehicle System มี
vin
สำหรับ Vehicle Identity
VIN แตกต่างจาก Plate
ตัวอย่าง
รถคันหนึ่ง
VIN = Identity หลัก
Plate = ป้ายทะเบียนที่แสดง
Plate อาจถูกเปลี่ยนตาม Gameplay ได้ง่ายกว่า
การมี Vehicle Identifier ที่แยกออกมาช่วยให้ Persistence แข็งแรงขึ้น
㉗ Vehicle Owner เป็นใครได้บ้าง
Current Vehicle Schema รองรับ
owner
ที่เชื่อมกับ Character
และ
group
สำหรับ Vehicle ที่เป็นขององค์กร
จึงสร้างได้ทั้ง
Personal Vehicle
และ
Police Vehicle
Company Vehicle
Gang Vehicle
ตาม Resource Design
㉘ Ox.CreateVehicle ทำอะไร
Current Server API มี
Ox.CreateVehicle(data, coords, heading)
สำหรับสร้าง OxVehicle
หาก Vehicle มี Owner หรือ Group Framework สามารถ Save ลง Database ตาม Architecture
นี่ช่วยให้ Garage/Dealership Resources ใช้ Vehicle Core ร่วมกันได้
㉙ Ox.GetVehicleFromVin มีหรือไม่
มี
Current APIs สามารถค้นหา Vehicle จาก
Entity
Network ID
VIN
Filter
ได้
เช่น
Ox.GetVehicleFromVin(vin)
เหมาะกับ Resources ที่ต้องติดตามรถแบบ Persistent มากกว่าการใช้ Entity Handle เพียงอย่างเดียว
㉚ ox_core มี Vehicle Persistence ดีอย่างไร
แนวคิดสำคัญคือรถไม่ได้ถูกมองเป็นเพียง Entity ที่เกิดในโลกเกม
แต่เป็น
Persistent Vehicle Data
↓
Database
↓
OxVehicle
↓
Game Entity
ทำให้ระบบอย่าง
Garage
Impound
Keys
Dealership
Police
Ownership
สามารถเชื่อม Vehicle Record เดียวกันได้
㉛ SaveAllVehicles มีหรือไม่
มี
Current Server API มี
Ox.SaveAllVehicles()
เช่นเดียวกับ
Ox.SaveAllPlayers()
ซึ่งแสดงให้เห็นว่า Framework มี Persistence Layer สำหรับทั้ง Player และ Vehicles
㉜ ox_core มี Licenses หรือไม่
มี
Current Database มี
ox_licenses
character_licenses
พร้อม Default License ตัวอย่าง เช่น
weapon
driver
และ Current API สามารถอ่าน License Definitions ได้
จึงสามารถสร้าง Gameplay เช่น
Driver License
Weapon License
Professional License
ต่อได้
㉝ ox_core มี Status System หรือไม่
มี
Current Database มี
ox_statuses
พร้อม Default Status ตัวอย่าง
hunger
thirst
stress
และ Character มี
statuses
เก็บ State
จึงรองรับ Survival/RP Status ได้ใน Core Architecture
㉞ Death System มีหรือไม่
มี Built-in Death System ที่สามารถ Config ได้
Current Convar
ox:deathSystem
ใช้เปิด/ปิดระบบ Death/Respawn Built-in
หากปิด Core ยังสามารถตั้ง Player State และ Trigger Event ที่เกี่ยวข้องตามระบบได้
ดังนั้น Server สามารถใช้ Death Resource ภายนอกได้หากต้องการ
㉟ Character Selection มี Built-in หรือไม่
Current Config มี
ox:characterSelect
สำหรับ Built-in Character Registration/Selection Behavior
และมี
ox:characterSlots
สำหรับจำนวน Character Slots
ดังนั้น Core มี Character Architecture ในตัว
ไม่จำเป็นต้องมองหา Multicharacter Resource ทันทีโดยไม่ตรวจ Built-in Feature ก่อน
㊱ ox:characterSlots คืออะไร
Default ปัจจุบันคือ
1
และสามารถตั้งจำนวน Character Slots สำหรับ Character Selection Resources
ตัวอย่าง
setr ox:characterSlots 3
ตามความต้องการของ Server
แต่ก่อนเปลี่ยนควรตรวจ Character Selector ที่ใช้อยู่ด้วย
㊲ ox:spawnLocation คืออะไร
Current Config มี Default Spawn Location สำหรับ Character ใหม่
สามารถกำหนดผ่าน Convar
แนวคิด
New Character
↓
Default Spawn
หากใช้ Spawn Selector ภายนอกก็ต้องออกแบบ Integration ไม่ให้ระบบชนกัน
㊳ ox_core ใช้ Config แบบไหน
Current Documentation ระบุว่า Resource Configuration จัดการผ่าน
Convars
เป็นหลัก
ตัวอย่าง
ox:debug
ox:characterSlots
ox:plateFormat
ox:deathSystem
ox:characterSelect
ox:spawnLocation
ox:defaultVehicleStore
ดังนั้นไม่ควรเปิด Source แล้วแก้ค่าทุกอย่างโดยตรงก่อนตรวจว่า Framework มี Convar สำหรับสิ่งนั้นหรือไม่
㊴ ox:plateFormat คืออะไร
เป็น Configuration สำหรับรูปแบบป้ายทะเบียนรถ
Current Default มีรูปแบบประมาณ
........
ซึ่งเชื่อมกับ GTA Vehicle Plate Pattern
Server จึงสามารถกำหนด Plate Format ผ่าน Configuration แทนแก้ Vehicle Core เอง
㊵ ox:defaultVehicleStore คืออะไร
ใช้กำหนด Store ที่รถ Persistent จะถูกส่งไปในเงื่อนไขตอน Resource Start ตาม Behavior ของ Framework
Default ปัจจุบันมีแนวคิด
impound
ดังนั้น Garage/Impound Resource ควรเข้าใจ Core Vehicle Storage Model ก่อนสร้าง Logic ซ้อนขึ้นมาอีกระบบ
㊶ ox_core ใช้ Database อะไร
Current Installation Documentation ระบุให้ Setup
MariaDB 11.4+
สำหรับ ox_core
ดังนั้น Server ใหม่ควรใช้ MariaDB รุ่นที่ Current Documentation รองรับ
ไม่ควรยึด Database Stack จาก Tutorial FiveM รุ่นเก่าโดยไม่ตรวจ Requirement
㊷ ทำไม Database Version สำคัญ
Current install.sql ใช้ Database Features หลายอย่าง เช่น
JSON
Generated Columns
Foreign Keys
CREATE INDEX IF NOT EXISTS
และ Data Model มี Relationships จำนวนมาก
ดังนั้น Database รุ่นเก่าเกินไปอาจทำให้ Installation/Migration Error
ควรตรวจ Version ก่อน Debug Core
㊸ Database Structure ของ ox_core เป็นแบบ Relational มากไหม
ค่อนข้างชัดเจน
ตัวอย่างความสัมพันธ์
users
↓
characters
↓
character_groups
character_licenses
accounts
vehicles
และ Groups มี
ox_groups
↓
ox_group_grades
Accounts มี
accounts
↓
accounts_access
accounts_transactions
จึงเป็น Framework ที่มี Database Model ค่อนข้างเป็นระบบ
㊹ ox_core ต้องใช้ ox_inventory หรือไม่
Current Installation Documentation ระบุ ox_inventory เป็น Optional Dependency ที่แนะนำอย่างมาก
ดังนั้น
ox_core
ไม่ได้เท่ากับ
ox_inventory
และ Core สามารถถูกพัฒนาแยกจาก Inventory
แต่สำหรับ RP Stack เต็ม ox_inventory เป็น Resource ที่เข้ากันกับ Ecosystem อย่างชัดเจน
㊺ Optional Dependencies ที่แนะนำมีอะไร
Current Documentation ระบุ Resources เช่น
ox_inventory
npwd
illenium-appearance
เป็น Optional Dependencies ที่แนะนำ
จุดนี้แสดงว่า Framework Core ไม่ได้พยายามรวม
Inventory
Phone
Appearance
ทั้งหมดไว้ในตัวเดียว
แต่เปิดให้เลือก Resources แยกตาม Architecture
㊻ ox_core กับ ox_inventory ต่างกันอย่างไร
ox_core
Player
Character
Groups
Accounts
Vehicles
Persistence
ox_inventory
Items
Slots
Metadata
Stashes
Inventory UI
ตัวอย่าง
ox_core
→ รู้ว่า Character คือใคร
ox_inventory
→ รู้ว่า Character ถือ Item อะไร
สองระบบเชื่อมกันได้ แต่ไม่ใช่ Resource เดียวกัน
㊼ ox_core กับ ox_lib ต่างกันอย่างไร
ox_core
Framework
ox_lib
Shared Library
ox_lib ให้เครื่องมือ เช่น
Callbacks
UI
Zones
Utilities
Locale
ส่วน ox_core ให้ Framework Data Model
ดังนั้น Custom Resource สามารถใช้ทั้งสองพร้อมกันได้
㊽ ox_core กับ oxmysql ต่างกันอย่างไร
ox_core
Framework Logic
oxmysql
Database Interface
Architecture คือ
ox_core
↓
oxmysql
↓
MariaDB
อย่าสับสนว่า oxmysql จัดการ Player Framework ให้เอง
มันเป็นเพียง Database Layer
㊾ ox_core กับ Qbox ต่างกันอย่างไร
ทั้งสองเป็น Framework แต่คนละ Project
ox_core
เน้น
OxPlayer
OxVehicle
Groups
Accounts
Persistence
Qbox
ใช้
qbx_core
และมี Architecture ที่พัฒนามาจาก QBCore พร้อม QB compatibility
ทั้งสองใช้ OX Resources ได้มาก แต่ Qbox ไม่ใช่ ox_core
㊿ ox_core กับ ESX ต่างกันอย่างไร
ESX ใช้
es_extended
xPlayer
ESX Accounts
Jobs
ESX ecosystem
ส่วน ox_core ใช้ Data Model ของตัวเอง เช่น
OxPlayer
Groups
Accounts
OxVehicle
Characters
ดังนั้น ESX Script ไม่สามารถนำมาใช้บน ox_core โดยตรงหากไม่มี Bridge
51. ox_core กับ QBCore ต่างกันอย่างไร
QBCore ใช้
qb-core
QBCore Object
PlayerData
Jobs
Gangs
ส่วน ox_core ใช้
Ox
OxPlayer
Groups
Accounts
Vehicles
และ APIs ของตัวเอง
จึงเป็น Framework คนละ Ecosystem
อย่าเลือก Script ที่เขียนว่า QBCore แล้วคาดว่าจะใช้บน ox_core ได้ทันที
52. Script สำหรับ ox_core หาเยอะไหม
เมื่อเทียบกับ
ESX
QBCore
Native Third-party ecosystem ของ ox_core อาจไม่กว้างเท่า Framework ที่มีฐาน Server ขนาดใหญ่และยาวนานกว่า
ก่อนเลือก ox_core สำหรับ Production จึงควรสำรวจ Scripts สำคัญก่อน เช่น
Phone
Housing
Police
EMS
Garage
Businesses
Character Appearance
ว่ามี Integration ที่เหมาะสมหรือไม่
53. ox_core เหมาะกับ Developer มากกว่ามือใหม่หรือไม่
ในหลายกรณี ใช่
เพราะ ox_core เหมาะกับทีมที่เข้าใจ
Lua
Exports
Modules
Events
Database
Relational Data
Resource Architecture
และต้องการสร้าง Custom Resources รอบ Public APIs
ถ้าต้องการเพียง Download Server Pack แล้วเปิดทันที Framework ที่มี Ecosystem Ready-made มากกว่าอาจง่ายกว่า
54. ox_core เหมาะกับ Custom RP Server ไหม
เหมาะมาก
โดยเฉพาะ Server ที่ทีมต้องการควบคุม Architecture เอง
เช่น
Custom Economy
Custom Groups
Custom Vehicle System
Custom Jobs
Custom Businesses
Custom Permissions
แทนการประกอบ Scripts สำเร็จรูปหลายสิบตัวที่มี Data Model คนละแบบ
55. ox_core เหมาะกับ Serious RP ไหม
เหมาะ
เพราะ Data Model มีองค์ประกอบสำคัญอย่าง
Characters
Groups
Accounts
Licenses
Statuses
Vehicles
Permissions
ซึ่งตรงกับ Requirement ของ Serious RP หลายอย่าง
แต่ยังต้องมี Gameplay Resources เพิ่ม เช่น
Police
EMS
Phone
Housing
Jobs
Businesses
Framework ไม่ได้สร้าง Gameplay ทั้ง Server ให้เอง
56. ox_core เหมาะกับ Economy RP ไหม
เหมาะเช่นกัน
โดยเฉพาะ Current Account Architecture ที่รองรับ
Personal Accounts
Group Accounts
Access Roles
Transactions
ช่วยให้สามารถสร้าง Banking/Business Economy ที่ซับซ้อนได้
แต่ Economy Balance ยังขึ้นกับการออกแบบ Server ไม่ใช่ Framework เพียงอย่างเดียว
57. ox_core เหมาะกับ Drift Server ไหม
ถ้า Drift Server ต้องการแค่
รถ
Track
Drift Score
Leaderboard
อาจไม่จำเป็นต้องใช้ Framework ขนาดนี้
Standalone Resources อาจง่ายกว่า
แต่ถ้าต้องการ
Character
Persistent Cars
Money
Businesses
Vehicle Ownership
ox_core ก็สามารถเป็น Framework ได้
58. ox_core เหมาะกับ Racing Server ไหม
หลักเดียวกัน
ถ้า Racing Server มี
Persistent Characters
Owned Vehicles
Bank Accounts
Progression
Organizations
Framework มีประโยชน์
แต่ถ้าเป็น Session-based Racing ธรรมดา การมี Player/Accounts/Groups Framework เต็มชุดอาจเพิ่ม Complexity โดยไม่จำเป็น
59. ox_core เหมาะกับ Server ที่ซื้อ Script เยอะหรือไม่
ต้องตรวจ Marketplace ก่อน
เพราะ Commercial Scripts จำนวนมากมักประกาศ
ESX
QBCore
Qbox
เป็นหลัก
หากไม่มี Native ox_core Bridge คุณอาจต้องสร้าง Adapter เอง
ดังนั้น Server ที่พึ่ง Paid Scripts จำนวนมากควรทำ Compatibility Matrix ก่อนเลือก Framework
60. ox_core เหมาะกับ Server แบบไหนที่สุด
เหมาะมากกับ
Custom FiveM RP Server
Developer-heavy Server
Serious RP
Economy RP
Server ที่ต้องการ Player/Vehicle Persistence เป็นระบบ
Server ที่ต้องการ Group/Permission Architecture
Server ที่ต้องการ Account System ที่ยืดหยุ่น
ทีมที่ต้องการใช้ OX ecosystem
ทีมที่เขียน Custom Resources เองจำนวนมาก
อาจไม่ใช่ตัวเลือกแรกสำหรับ
Server Pack มือใหม่ที่ต้องการ Script สำเร็จรูปจำนวนมาก
Server ที่มี ESX/QBCore Scripts เก่าเต็มระบบ
Drift/Freeroam แบบง่าย
ทีมที่ไม่มี Developer ดูแล Integration
จุดเด่นของ ox_core
จุดเด่นสำคัญคือ
Player + Character แยกชัด
User
↓
Characters
Group System ยืดหยุ่น
สามารถทำ
Jobs
Gangs
Businesses
Organizations
ด้วย Data Model กลาง
Permission System
กำหนด Permission ตาม Group/Grade ได้
Account System
รองรับ Personal/Shared/Group Accounts และ Transaction History
Vehicle Persistence
มี OxVehicle, Owner, Group, VIN และ Persistent Data
Public APIs
Custom Resources สามารถเรียก Framework Functions แทน Direct Database Access
Modular Ecosystem
Inventory, Phone, Appearance สามารถเป็น Resources แยก
เหมาะกับทีมที่ต้องการ Architecture ที่สะอาด
ข้อควรพิจารณาของ ox_core
ก่อนเลือกควรดู
Native Script Support
Commercial Scripts อาจรองรับ ESX/QB/Qbox มากกว่า
Developer Requirement
ต้องเข้าใจ Framework APIs มากพอ
Database Requirement
Current Documentation แนะนำ MariaDB 11.4+
Ecosystem Planning
ต้องเลือก
Inventory
Phone
Appearance
Target
Housing
Jobs
ให้เข้ากัน
Migration
การย้าย ESX/QBCore Production Database มา ox_core ไม่ใช่เพียงเปลี่ยน Core Folder
ต้องวางแผน Data Conversion
วิธีใช้ ox_core ใน Custom Lua Resource
Current Documentation รองรับการ Import Definition ด้วย
shared_script '@ox_core/lib/init.lua'
จากนั้น Resource จะสามารถใช้ API ที่ Framework เปิดให้
อีกวิธีคือใช้ require ผ่านระบบที่รองรับตาม Documentation
สำหรับ JavaScript/TypeScript ยังมี Package ของ ox_core สำหรับ Developer ด้วย
แสดงว่า Framework ถูกออกแบบให้ใช้เป็น Development Foundation จริง ๆ
อย่า Query Core Database โดยตรงถ้าไม่จำเป็น
สมมติต้องหา Player
ถ้า Framework มี
Ox.GetPlayer(...)
ควรใช้ API
แทน
SELECT * FROM characters ...
ในทุก Action
เช่นเดียวกับ Groups, Accounts และ Vehicles
การใช้ Public API ช่วยให้
State ถูกต้อง
Cache ถูกต้อง
Persistence ถูกต้อง
Update Framework ง่ายขึ้น
มากกว่า Direct SQL
ox_core ทำให้ Server เบาเสมอไหม
ไม่
Performance Server ยังขึ้นกับ
Custom Scripts
Phone
Inventory
Housing
Database Queries
Entities
Maps
Players
Loops
ทั้งหมด
Framework ที่ออกแบบดีช่วยเรื่อง Architecture แต่ไม่ได้ทำให้ Resource ที่เขียนไม่ดีหายช้าโดยอัตโนมัติ
ต้อง Profile Server จริง
ox_core ทำให้ Server ปลอดภัยอัตโนมัติไหม
ไม่
Custom Resources ยังต้อง Validate Client Input บน Server
ตัวอย่างที่ไม่ควรทำ
Client
→ ส่ง amount = 999999
Server
→ เพิ่มเงินตาม Client
ถึงจะใช้ OxAccount ก็ยังไม่ปลอดภัย
Server ต้องเป็น Authority สำหรับ
Money
Items
Permissions
Rewards
Vehicles
Groups
เสมอ
Checklist ก่อนเลือก ox_core
Server Type
เป็น RP หรือไม่
ต้องมี Persistent Characters หรือไม่
ต้องมี Vehicle Ownership หรือไม่
ต้องมี Economy หรือไม่
ต้องมี Groups/Businesses หรือไม่
Development
มี Lua Developer
เข้าใจ Exports/Modules
เข้าใจ Database
ทำ Custom Resources ได้
Database
ใช้ MariaDB ตาม Requirement
Backup ได้
มี Test Database
Ecosystem
ตรวจ
ox_inventory
Phone
Appearance
Housing
Garage
Target
Voice
ว่ามี Resource ที่เหมาะสม
Third-party Scripts
ตรวจว่า
Native ox_core
Multi-framework
หรือ
ต้องสร้าง Bridge
Maintenance
รักษา Core ให้ใกล้ Official
ใช้ APIs แทนแก้ Core
มี Test Server
Backup ก่อน Update
ox_core เหมาะกับใครแบบสั้นที่สุด
ทีม Developer ทำ Server เองเยอะ
เหมาะมาก
Serious RP แบบ Custom
เหมาะมาก
Economy/Business RP
เหมาะ
ต้องการ Persistent Vehicle System
น่าสนใจมาก
ต้องการซื้อ ESX/QB Script สำเร็จรูปจำนวนมาก
ตรวจ Compatibility ก่อน
QBCore Production Server ใหญ่
ไม่ควร Migration เพียงเพราะอยากลองของใหม่
ESX Production Server ใหญ่
ต้องประเมิน Migration Cost อย่างจริงจัง
Drift/Freeroam ง่าย ๆ
Framework อาจไม่จำเป็น
สรุป ox_core คืออะไร เหมาะกับ Server แบบไหน
ox_core คือ Modern FiveM Framework สำหรับ Player และ Vehicle Management รวมถึง Persistence โดยมี Data Model ที่ครอบคลุม
Users
Characters
Groups
Group Grades
Permissions
Accounts
Transactions
Licenses
Statuses
Vehicles
Current API มี Objects/Functions อย่าง
OxPlayer
OxVehicle
OxAccount
Ox.GetPlayer
Ox.GetPlayers
Ox.CreateGroup
Ox.GetGroup
Ox.CreateAccount
Ox.GetCharacterAccount
Ox.CreateVehicle
Ox.SpawnVehicle
Ox.SaveAllPlayers
Ox.SaveAllVehicles
ทำให้ Framework สามารถเป็น Foundation ของ Custom RP Server ได้จริง
จุดเด่นที่ต่างจาก Framework แบบดั้งเดิมบางตัวคือ Vehicle Persistence และ Account/Group Architecture ถูกวางเป็นส่วนสำคัญของ Core ตั้งแต่ต้น รวมถึงมี Permission System สำหรับ Group Grades
อย่างไรก็ตาม
ox_core
≠
OX Ecosystem ทั้งหมด
คุณไม่จำเป็นต้องใช้ ox_core เพียงเพราะใช้
ox_lib
oxmysql
ox_inventory
ox_target
และในทางกลับกัน การใช้ ox_core ก็ยังต้องเลือก Resources อย่าง Inventory, Phone, Housing และ Appearance เพิ่มตาม Requirement
Current Installation Documentation แนะนำ MariaDB 11.4+ และระบุ ox_inventory, npwd และ illenium-appearance เป็น Optional Dependencies ที่แนะนำ ซึ่งสะท้อนแนวคิด Modular ของ Framework อย่างชัดเจน
สำหรับ comsiam มองว่า ox_core เหมาะที่สุดกับ Server ที่มีทีม Developer และตั้งใจสร้าง Custom Architecture ระยะยาว เพราะสามารถใช้ Player, Groups, Accounts และ Vehicle APIs เป็น Foundation แล้วสร้าง Gameplay Resources แยกออกมาได้สะอาด
แต่ถ้า comsiam ต้องเลือกระหว่าง ox_core กับ ESX/QBCore สำหรับ Server ที่มี Paid Scripts เดิมหลายสิบตัว สิ่งแรกที่จะตรวจคือ Compatibility ของ Phone, Housing, Police, Garage และ Jobs ก่อน เพราะ Framework ที่ Architecture ดีมากแต่ทำให้ต้อง Rewrite Resource ส่วนใหญ่ อาจไม่ใช่ตัวเลือกที่คุ้มที่สุดสำหรับ Production Server นั้น
Comments
Post a Comment