I know there are several other scripts around that prevent your recent vehicles from just disappearing when youre not looking at them. But I was just not happy with the way they all seemed to work and was always bothered by the little bugs and annoyances that came with them.
So I decided to would write my own script in lua to basically do the same thing but with the features that I wanted and also hopefully try to resolve some of the issues of the older persistence scripts.
Your last 8 (by default) vehicles used will not randomly disappear when you turn your back. NOTE: They wont be persistent between save loads!
If there is already 8 (by default) vehicles that are being saved, the one you havent used in the longest will be overwritten.
A small blip will be shown on the map for each of the saved vehicles. The type of blip will vary depending on the vehicle type.
The color of the blip will depend on which of model you were playing as when that vehicle was saved: > Michael: Blue > Franklin: Green > Trevor: Orange > Any other model: Yellow
The blip wont show up for the current vehicle you are driving, only vehicles you are not in will have blips on the map.
Vehicles that already have a blip *should* not have their blips affected by this script.
If a vehicle is destroyed, it will be removed from the list of saved cars and allowed to despawn as normal.
If you switch characters, the saved vehicle list will be wiped. The only way I can think of to save cars when switching characters is really not worth the effort it would take to do it. There is also a side effect to this, if you change to a different model while still playing as the same character, the saved cars are reset as well. If someone knows a way to determine which character is being played without checking the model or the ped type, please contact me.
There is also a menu (default keys: Shift+I) that has the following options (enabled options will be red with stars): > Enable Script: This might be useful for times when persistent vehicles cause problems during some missions. > Enable Blips: Use this option to turn on/off the blips for saved vehicles. > Reset Vehicle List: This will clear the list of saved vehicles.
You can change the settings in the 'Configuration' section located below the comment section of the PersistentVehicles.lua file.
Version 1.2 (06.25.16) - Now setup so you need to press 2 keys together for the menu - Changed default menu option to avoid accidentally turning mod off - Changed default menu key from 'T' to 'Shift+I'
Version 1.1 (10.24.15) - Code improvement to detecting character
EnableScript = true -- Enable the script by default [true/false] (default: true) EnableBlips = true -- Enable the blips by default [true/false] (default: true)
local NumVehicles_Max = 8 -- Max number of vehicles to save (default: 8)
local Menu_Key1 = Keys.I -- Press this key in combination with Menu_Key2 to bring up the menu (default: Keys.I) local Menu_Key2 = Keys.ShiftKey -- Press this key in combination with Menu_Key1 to bring up the menu (default: Keys.ShiftKey)
-------------------------------------------------- -------------------------------------------------- * please do not upload my mods to other sites! * -------------------------------------------------- --------------------------------------------------