Streaming Custom Assets in FiveM — Vehicle, Ped, and Map
Streaming Custom Assets in FiveM
Streaming custom content is what makes a server unique. FiveM supports streaming vehicles, characters, textures, maps and more.
Streaming Resource structure
my-stream/
├── fxmanifest.lua
└── stream/
├── vehicles/
│ ├── mycar.yft
│ ├── mycar.ytd
│ └── mycar+hi.yft (high detail LOD)
├── peds/
│ ├── moped.ydd
│ └── moped.ytd
└── maps/
└── myinterior.ymap
fxmanifest.lua for Streaming
fx_version 'cerulean'
game 'gta5'
-- Announcement of data files for vehicles
data_file 'HANDLING_FILE' 'data/handling.meta'
data_file 'VEHICLE_METADATA_FILE' 'data/vehicles.meta'
data_file 'CARCOLS_FILE' 'data/carcols.meta'
data_file 'VEHICLE_VARIATION_FILE' 'data/carvariations.meta'
data_file 'CONTENT_UNLOCKING_META_FILE' 'data/dlctext.meta'
-- Announcement ped data
data_file 'PED_METADATA_FILE' 'data/peds.meta'
data_file 'ANIMGROUP_OVERRIDE_METADATA' 'data/pedpersonality.ymt'
files {
'data/*.meta',
'data/*.ymt'
}
Stream Custom Vehicle
Required files
| File | Description |
|---|---|
modelname.yft |
3D model |
modelname+hi.yft |
High-detail LOD |
modelname.ytd |
Textures |
vehicles.meta (minimum)
<?xml version="1.0" encoding="UTF-8"?>
<CVehicleModelInfo__InitDataList>
<residentTxd>vehshare</residentTxd>
<InitDatas>
<Item>
<modelName>mycar</modelName>
<handlingId>mycar</handlingId>
<gameName>MYCAR</gameName>
<vehicleMakeName>CUSTOM</vehicleMakeName>
<expressionDictName>null</expressionDictName>
<vehicleClass>VC_SPORTS</vehicleClass>
<vehicleType>VEHICLE_TYPE_CAR</vehicleType>
<plateType>VPT_FRONT_AND_BACK_PLATES</plateType>
<txdName>mycar</txdName>
<type>AUTOMOBILE</type>
<layout>AUTO_LAYOUT_STANDARD</layout>
<maxOccupants>3</maxOccupants>
<numDoors>4</numDoors>
</Item>
</InitDatas>
</CVehicleModelInfo__InitDataList>
Spawn Custom Vehicle in Lua
local function SpawnCustomVehicle(model, coords, heading)
local hash = GetHashKey(model)
RequestModel(hash)
while not HasModelLoaded(hash) do
Citizen.Wait(10)
end
local vehicle = CreateVehicle(hash, coords.x, coords.y, coords.z, heading, true, false)
SetVehicleOnGroundProperly(vehicle)
SetModelAsNoLongerNeeded(hash)
return vehicle
end
-- use
local veh = SpawnCustomVehicle('mycar', GetEntityCoords(PlayerPedId()), 0.0)
SetPedIntoVehicle(PlayerPedId(), veh, -1)
Stream Custom Ped
Required files
| File | Description |
|---|---|
pedname.ydd |
3D model |
pedname.ytd |
Textures |
pedname.ycd |
Clips/animations (optional) |
peds.meta
<?xml version="1.0" encoding="UTF-8"?>
<CPedModelInfo__InitDataList>
<InitDatas>
<Item>
<Name>moped</Name>
<AssetName>moped</AssetName>
<RelationshipGroup>CIVMALE</RelationshipGroup>
<NavCapabilities>NAVMESHCAPS_FULL</NavCapabilities>
<DefaultSpawnSetName>DEFAULT</DefaultSpawnSetName>
<Pedtype>PED_TYPE_CIVMALE</Pedtype>
</Item>
</InitDatas>
</CPedModelInfo__InitDataList>
Texture Replacement
Replace texture of vanilla game (e.g. change sign, change surface texture):
stream/
└── prop_sign_01.ytd -- Name must match vanilla asset.
FiveM will automatically override the original texture with your custom texture.
Performance Tips
- LOD files Very important. If there is no vehicle, it will pop-in.
- Texture resolution not more than 2048x2048 for performance.
- Consolidate assets in a single resource instead of distributing them.
- Test streaming distance before deploying.
Summary
Custom streaming opens the world for servers to have their own unique content, starting with vehicle streaming first and then expanding to maps and custom peds.
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 ง่ายขึ้นมาก