How to Refresh Car Models and Textures in FiveM Without Reconnecting

Editing a car's model or textures and reconnecting after every change gets old fast. FiveM's str_requestFlush command makes the game drop the files it has already streamed, so your new 3D model and textures show up without leaving the server.

TL;DR:

  1. Turn on flushing with a small server-side script (str_enableFlush).
  2. Replace the .yft or .ytd in the resource's stream folder.
  3. Delete the car in game.
  4. Restart the resource: restart mycar.
  5. Press F8 and run str_requestFlush.
  6. Spawn the car again.

1. Turn on flushing

str_requestFlush only works when the server has str_enableFlush turned on. Add this to any server-side script:

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(1000)
        SetConvarReplicated('str_enableFlush', 'true')
    end
end)

If you'd rather keep it separate, make a small resource for it, for example a folder called dl-flush with these two files:

fxmanifest.lua

fx_version 'cerulean'
game 'gta5'

server_script 'server.lua'

server.lua: the code above. Then add ensure dl-flush to server.cfg.

Without it, the F8 console only answers with:

str_requestFlush requires the 'str_enableFlush' replicated convar to be enabled

It's meant for testing, so run it on your test or development server, not your live one.

2. Replace the files

Save the edited model (.yft) or texture dictionary (.ytd) with exactly the same name and put it in the resource's stream folder, replacing the old one. If the server runs on a host, upload it and check the upload really finished.

3. Delete the car

Get out of the car and delete it in game, for example with your server's delete vehicle command. The old model and textures stay loaded as long as the car is out.

4. Restart the resource

In the server console (or the txAdmin live console), restart the car's resource:

restart mycar

5. Flush in game

Press F8 to open the client console and run:

str_requestFlush

The game drops the streamed files it has in memory, so the next time the car loads it reads the new ones.

6. Spawn the car again

Spawn the car, for example with /car mycar. It should now have the new model and textures. To test another change, repeat steps 2 to 6.

Still seeing the old version?

  • The console says the convar isn't enabled: check the script from step 1 is running on the server.
  • The car was still out: delete it before you restart the resource and flush.
  • The file name changed: the new .yft or .ytd has to have exactly the same name as the old one.
  • The file didn't upload: compare the file size on the server with the one on your PC.
  • Still no luck: clear the FiveM cache and reconnect.

↑ Back to the steps

FAQ

Do my players need to run str_requestFlush?

No. It's for when you change files while you're already in the server. Players who join later download the new files anyway.

Can I leave str_enableFlush on my live server?

It's made for testing, so it's best to only run the script on a test or development server.

Does it refresh the 3D model too?

Yes. It reloads the .yft model as well as the textures, so you can test model changes the same way.

Why do I get 'requires the str_enableFlush replicated convar'?

Flushing isn't turned on. Add the server-side script from step 1 and make sure the resource it's in is started.

Need help?

If a car you bought from us still looks wrong after updating, open a ticket on our Discord:

https://discord.gg/4qp2bDEJbv

0 Kommentare

Hinterlasse einen Kommentar

Bitte beachte, dass Kommentare vor der Veröffentlichung freigegeben werden müssen.