A simple example resource for saving and replaying vehicle "ghosts"
- Download or clone this repository into your FiveM resources folder.
- Add
start fivem-ghost-replayto your server.cfg file. - Restart your FiveM server.
- Enter a vehicle in-game.
- Use the command
/ghostrecord startto start recording your vehicle's movements. - Use the command
/ghostrecord stopto stop recording. (You can provide a name for the recording:/ghostrecord stop myGhost) - Use the command
/ghostplay myGhostto replay the recorded ghost. - There is no stop playback command as this is just supposed to be an example resource. You can modify the code to add that functionality if needed.
- This resource is intended as a simple example and may require further development for production use.
- Recorded ghost data is stored in a folder called recordings. Make sure your server has write permissions to this folder.
- The recording frequency and data stored can be adjusted in the code as needed.
- More data can easily be added to the recording such as vehicle health, wheel angles, brake lights, indicators, and even full prop customizations if desired - Feel free to modify and expand upon this resource to suit your needs!
- Playback is all client side, meaning only the player who initiated the playback will see the ghost vehicle as this resources original intent was for players to be able to race along other players ghosts.