Skip to content

Commit

Permalink
Update save_gta_cache (#394)
Browse files Browse the repository at this point in the history
* Update save_gta_cache

Explain how to load saved cached data for clients/players, since it was
missing from the docs.

* Update console-commands.md

Remove old `__resource.lua` reference, which is no longer used.
  • Loading branch information
4mmonium committed Feb 19, 2024
1 parent 723d02b commit 949d87a
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions content/docs/client-manual/console-commands.md
Expand Up @@ -251,10 +251,28 @@ resource and shows this in a nice overview. Comes in handy when you encounter pe
Usage: `resmon <true|false>`

### save_gta_cache
<!-- TODO: reference a guide on GTA cache and using it in a resource -->
Saves cache data for a specified resource to the CitizenFX directory in AppData. This is to be used for resources with a
Saves cache data for a specified resource to the CitizenFX directory in AppData (`%AppData%\CitizenFX`). This is to be used for resources with a
significant amount of collision or map files, to speed up initial loading for players.

In order for players to load this file, it needs to be stored in the server's root folder of the resource you decided to save the map's cache for (not in a subdirectory) and added to your resource manifest.

In your resource manifest, `fxmanifest.lua`:

```
files {
'your_resource_name_cache_y.dat'
}
```

*Make sure the cache file name matches the one you saved and copied to your root resource directory, don't copy/paste the example as is.*

If you followed the steps correctly, you should see something like the following in your game log:

```
MainThrd/ loading CFX_PSEUDO_CACHE your_resource_name.
MainThrd/ done loading your_resource_name in data file mounter class CfxCacheMounter.
```

Usage: `save_gta_cache <resource name>`

### se_debug
Expand Down Expand Up @@ -374,4 +392,4 @@ Example: `test_ace group.admin command.adminstuff`

[faq-data]: /docs/support/client-faq#where-is-fivem-installed
[vconsole]: https://forum.cfx.re/t/20005
[manifest-reference]: /docs/scripting-reference/resource-manifest/resource-manifest/
[manifest-reference]: /docs/scripting-reference/resource-manifest/resource-manifest/

0 comments on commit 949d87a

Please sign in to comment.