CS Stories adds time-limited video stories to your FiveM phone. Players record short videos in-game and share them in a stories feed. It is a standalone resource that works with any framework and can be hooked into any Lua NUI-based phone. It comes with an extensive configuration, events, exports and some client and server source files, so you can customize it.
Features
- Short, temporary video stories with the uploader's in-game location and name
- Stories are shown for 24 hours by default and kept in storage for 24 hours by default; maximum length 30 seconds by default (about 5 MB per maximum-length video without thumbnail); rate limit to protect your storage
- Players can delete their own stories; authorized players can delete anyone's stories
- Simple stories feed with full mouse and keyboard navigation
- Switch between back and front camera; experimental camera mode that lets the player move while recording
- Color filters (grayscale, sepia, invert, saturate and more) and image filters with real-time ped face tracking (dog, cat and more)
- Adjusts to different screen resolutions
- Many events and exports to check and control the resource
- Included phone hooks: gcphone and qb-phone (also usable for phones based on them); hooks can be adjusted or written for other phones
- Optional companion resource cs-stories-dw to post stories to Discord for moderation or logging (follow Discord's webhook policies)
Requirements
- A Lua NUI-based phone and the yarn resource
- The included hosting server is mandatory. It stores videos, thumbnails and metadata, so it needs network, bandwidth and storage, plus an extra open TCP port (35540 by default). It is also available as an external node.js application (cs-stories-ehs) that you can run on another machine.
- If your phone uses
fx_version "cerulean", route the hosting server through HTTPS (for example with a domain and Cloudflare) or change the phone's fx_version to "bodacious".
Installation
- Make sure yarn is in your resources folder, place
cs-stories in your resources and add ensure cs-stories to your server config before your phone.
- In your phone's
__resource.lua or fxmanifest.lua, add '@cs-stories/client/hooks/core.lua' as the last client script and '@cs-stories/server/hooks/core.lua' as the last server script.
- In your phone's NUI file (usually
index.html), add <script type="text/javascript" src="nui://cs-stories/client/hooks/core.js"></script> right before </body>.
- Read all options in
config.js and adjust them to your setup.
- With the internal hosting server, open the TCP port (35540 by default, inbound) in your firewall.
- Run
refresh and ensure cs-stories. If your phone uses an animation loop, add a not CS_STORIES.ACTIVE check before playing the animation, then ensure your phone.
- With the external hosting server: install it with
npm install, configure its config.js, run it with node (for example with pm2) and add its IP address to sv_proxyIPRanges in your server config.
Important information
- Players are asked for microphone approval. If they deny by mistake, they must delete
%AppData%\CitizenFX\media_access.json to reset it.
- Only the recording player's voice is recorded, using the system default microphone. Talking is detected with the built-in native; with an external VoIP such as TokoVoip you need to edit the hook.
- A recording player cannot move (default GTA V camera behavior) unless you use the experimental camera mode.
- Video render lag or freezes may happen at very high resolutions or on very low-spec systems.
- Recording uses game capture: everything in the game is recorded, including visual settings and mods and game UIs, but not NUIs.
- If your server runs behind a reverse proxy that cannot handle an extra TCP port, host the stories server externally on a different machine.
- Uploading and viewing stories uses the players' and the hosting server's bandwidth. If your hosting server host has limited bandwidth, check your usage and storage regularly.
- Story metadata is stored in FiveM's KV storage; on a shared multi-server setup set
sv_kvsName to something unique.
- Video and location are checked, but since the client sends them they cannot be fully trusted.
- Expired stories are deleted when the resource starts, so cleanup depends on how often you restart.
Troubleshooting
- Errors when viewing or uploading: check the HTTPS/fx_version note above. Otherwise the cause is usually TCP blocking, a complex network setup or anti-DDoS protection; try a different, high port and make sure it is open for TCP, or host the stories server externally.
- No stories app button: make sure you use the correct hook for your phone and that its events and DOM elements match. Some hooks add the app to the phone's app store instead of the home screen.
- yarn keeps reinstalling: edit
package.json, add or remove a space, and save it.