Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Idea: Crash Recovery Script

Featured Replies

Hey modders! I got an idea for you for a small script to help with recovering from a crash. As a YT'er who live streams LSPDFR, whenever I experience a crash it takes me a few min to get back into the game and then to set up all of the things I prepped for the stream. I was thinking it would be great to have a little script where I can do it at a push of a button to immediately restore some settings without having to spend time using the trainer.

 

If it's possible, it would be great to have a little script that at a push of a button can save things like:

 

  • Your current character model + EUP outfit + any other components/extras
  • Current weapon loadout
  • If you're in the vehicle, your vehicle model
  • Current game time and weather
  • Your current location in the game

 

So the thought is, I set it all up at the start and save it. Then if the game crashes and I reload, I don't have to spend more time getting it all re-set again with the trainer, I can just push another button and those settings will be immediately restored. Then I can just go into the trainer to freeze the time/weather or enable god mode or unlimited ammo, but I don't have to spend the time setting up outfits, spawning cars, re-adding any extra weapons or fixing the weather or teleporting.

 

Anyway just a  thought, I appreciate any considerations or attempts at this!

Hey @gmantonz,

 

Fancy seeing you here 🙂

 

So I am wanting to write a plugin, but my idea is way too complicated for a first go and reading what you are asking and watching your streams I thought I could give back by having a go, even  if I cant get all that you need, some features may help and if i make the code open source others may jump in and help too. 

 

I have a couple of bugs to iron out but hope to be able to share something tomorrow. So far i have:

 

Backup on press of button and automatically (if enabled)

 

Backup to an XML file, so even a full computer reboot will still keep backup available. Could also use it as a return point from a previous session. 

 

Restore at push of a button.

 

HoyKeys and auto backup configurable in ini file

 

So far the following is backed up and restored (the easy bits):

- current player location

- current in game time

-current vehicle, if driving or last vehicle (and where you left it) if not.

 

Some DLC vehicles (casino heist) seem to cause game crash so tomorrow I wa.t to error handle that until the actual failure can be fixed, seems to relate to vehicle hashes.

 

Still need to work out

How to get current character(I assume this is the LSPDFR char rather than a trainer configured player?

How to get the EUP that was in use

How to get weapon load out/ ammo

How to get weather... can set easily but looks like I cannot get current weather in RPH and may have needed to use script hook instead. 

 

If anyone knows how to help with these do reach out as I am really a noob on the molding front and hope this isn't just a pile of junk... 

 

Wayne

RecovFR 0.2.1.0 Pre-Release: Download here

 

Current features:

  • Backup stored in xml file, so even after full game crash or exit, backup can be restored
  • Backup the following at the press of a button or automatically (if enabled): 
    • Current character location
    • Wanted level
    • Health and armor
    • Current vehicle (if in vehicle) or Last vehicle and location (if on foot)
      • Vehicle colors and dirt level
      • License Plate and style
    • Current time in game
  • Restore last backup at press of button

Planned features (if I can work out how): 

  • Current character model
  • Current Character uniform (if EUP in use)
  • Current weapon loadout and ammo
  • Current weather conditions 
  • Vehicle skin/livery

Known issues: 

  • Some DLC vehicles cannot be recovered, investigating cause

 

 

 

 

 

 

 

  • Author

Thank you @waynieoaks for taking a stab at this, already seeing the benefits of the first release and I just tested it in my game and it works great! I am going to post here also what I sent to waynieoaks privately, in case anyone else wants to contribute to the conversation of how to implement the other features. I was doing some Googling (with my limited coding knowledge) and this is what I've come across: 

 

Weather: I came across this mod: https://www.gta5-mods.com/scripts/weather-forecast They seem to utilize GTA.Native.Hash._GET_CURRENT_WEATHER_TYPE. Doing some more research on that brings up this post: https://gtaforums.com/topic/953942-get-current-weather-c/ Hopefully this will help get the current weather info.

 

Player model: dont know if this will be of any help: https://forums.gta5-mods.com/topic/13486/c-get-player-model/

 

Outfits/model: I came across this mod that stores player outfits: https://www.gta5-mods.com/scripts/sp-outfit-saving And it looks like they are able to get what props/textures are currently on the player model which would link back to EUP components: https://github.com/root-cause/v-spoutfits/blob/master/SPOutfits/Methods.cs

 

Weapons: Maybe this will help point you in the right direction? https://gtaforums.com/topic/808752-c-copy-all-weapons-and-ammo/ Seems like reading that post the thought is to check for all possible weapons and attachments that a player might have and if its true, save those, then give them back on restore.

 

Quick update on progress, for anyone following this - I am making (slow) progress on the outstanding issues. 

 

Weather: Cannot get with the RPH command, but can set - can get with native functions but struggling to work out native functions in RPH if anyone has any insight into that. 


Weapons: Again found some promising leads with native functions, thanks to Gmantonz research into this. I found a way to iterate through the weapons and ammo in an inventory, BUT if carrying a lot of weapons it would crash the game - so any experience here people can share would also be a massive help. 

 

Have not started on player / outfits yet, so again if anyone wants to help or contribute this could be a good area too?

 

Have found a lot of other vehicle features that could be backed up and restored, (Vehicle Health, Engine Health, Is Engine running, Are doors locked, Radio station, etc) but also want to get balance between functionality and impact on resource to prevent FPS issues or stuttering while a backup is taking place. e.g. Iterating through weapons,  I find can cause an in game mini-freeze and if the ped has tons of weapons (e.g. when I use the trainer to give me ALL the weapons) the backup will crash the game.

 

Finally I would like to be able to back up / restore the correct livery if the vehicle had a livery/skin option applied but have not yet looked into if this is possible. 

 

I could include in the ini the ability to turn on/off what is being backed up if this script is of use more widely in the community, so if people are interested in using this when finished, please do let me know.

 

Oh, and then once working, I want to optimize, reduce code etc to make as lightweight as possible to again reduce impact on the game itself.

Edited by waynieoaks

RecovFR 0.2.2.0 "Whatever the weather update" Pre-Release:

Download here ]

 

What's new: 

  • Backup script optimised
  • FIXED: Some DLC vehicles could not be restored
  • FIXED: Vehicle plate style was not restored
  • Added vehicle health levels
  • Added vehicle radio station
  • Added vehicle livery, rim color and window tint
  • Added weather, wind speed and wind direction

 

Planned features: 

  • Capture/restore current character model
  • Capture/restore if character wet or dry
  • Capture/restore clothing/props
  • Capture/restore weapons / ammo and components
  • Capture vehicle neon light configurations
  • Capture if ped or vehicle is indestructible
  • Capture if weather or time is frozen
  • Error handling and logging
  • Restructure XML to allow easier capture/restore of multiple items, e.g. weapons
  • Ability to turn off certain features in .ini file
  • Ability to turn on certain features at startup (vehicle / ped indestructible, weather, time)

Known issues: 

  • Investigating reports of weather not changing, possibly related to trainer?
  • Plugin crash on restore if backup was taken having never entered a vehicle. Fixed in next release.

 

Edited by waynieoaks
Updating known issues

RecovFR 0.3.1.0 "The Tooled-Up-Date" Pre-Release

[ Download here ] [ Source code ] [ Report a bug ]

 

What's New: 

  • Added character model
  • Added weapons, ammo and components
  • Enable player / vehicle invincibility on restore*
  • Enable frozen time and weather on restore*
  • Enable snow on terrain on restore*
  • Restructured INI and XML files
  • Better error handling
  • Fixed: plugin crash if restoring backup before entering a vehicle
  • Fixed: weather not changing from neutral to snow

Planned features: 

  • Backup / restore clothing and props
  • Ability to turn on / off features
  • Simple menu for controlling options in game

Known issues: 

  • Not sure vehicle invincibility is 100% but this could be conflict "Simple Trainer"
  • Please report any other issues found here.
  • 2 months later...

RecovFR 0.4.1.0 "The All Dressed-Up-Date" Pre-Release

Download here ] [ Source code ] [ Report a bug ]

 

Current features: 

  • Backup stored in xml file, so even after full game crash or exit, backup can be restored!
  • Backup the following states at the press of a button or automatically (if enabled): 
    • Current character location
    • Current clothing and accessories (NEW) Thank you @opus49 for saving me from insanity and getting this to work!
    • Current weapons, components and ammo
    • Wanted level
    • Health and armor
    • Player invincibility* 
    • Current vehicle (if in vehicle)
    • Last vehicle and location (if on foot)
    • Vehicle colors, livery and dirt level
    • License Plate and style
    • Vehicle health
    • Vehicle invincibility*
    • Current time in game
    • Current weather conditions
    • Freeze time and weather on restore*
    • Set snow on terrain on restore*
  • Restore last backup at press of button
  • Ability to turn on/off features in .ini file or via in game menu (NEW)

*These restore options are set in the ini file or in game menu

 

Planned features (If I am clever enough to work it out): 

  • Backup / restore the current character model and features#

#This may not be possible, as I can find the code to set character features but not all the required code to get the current features. 

 

Issues: 

Please report any issues here

Edited by waynieoaks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.