@Deltanic
Thanks for the great script.
Question:
I am not sure if the script is Legacy Fuel Compatible but it’s great otherwise. If it’s possible to integrate it to legacy please give some tips.
Also:
I did a little something that i think might help others.
Added All The Classes as individual cars that should be excluded under Utils.lua since i do not think some classes have NOS. Anyone who likes it can use it with your permission of course.
Excluded Classes:
SERVICE, VANS, SEDANS, SUVS, OFFROAD, INDUSTRIAL, COMPACTS, COMMERCIAL
local ELECTRIC_VEHICLES = {
--ELECTRIC
[GetHashKey('AIRTUG')] = true,
[GetHashKey('CYCLONE')] = true,
[GetHashKey('CADDY')] = true,
[GetHashKey('CADDY2')] = true,
[GetHashKey('CADDY3')] = true,
[GetHashKey('DILETTANTE')] = true,
[GetHashKey('IMORGON')] = true,
[GetHashKey('KHAMEL')] = true,
[GetHashKey('NEON')] = true,
[GetHashKey('RAIDEN')] = true,
[GetHashKey('SURGE')] = true,
[GetHashKey('VOLTIC')] = true,
[GetHashKey('TEZERACT')] = true,
--SERVICE
[GetHashKey('AIRBUS')] = true,
[GetHashKey('BRICKADE')] = true,
[GetHashKey('BUS')] = true,
[GetHashKey('COACH')] = true,
[GetHashKey('PBUS2')] = true,
[GetHashKey('RALLYTRUCK')] = true,
[GetHashKey('RENTALBUS')] = true,
[GetHashKey('TAXI')] = true,
[GetHashKey('TOURBUS')] = true,
[GetHashKey('TRASH')] = true,
[GetHashKey('TRASH2')] = true,
[GetHashKey('WASTELANDER')] = true,
--VANS
[GetHashKey('BISON')] = true,
[GetHashKey('BISON2')] = true,
[GetHashKey('BISON3')] = true,
[GetHashKey('BOBCATXL')] = true,
[GetHashKey('BOXVILLE')] = true,
[GetHashKey('BOXVILLE2')] = true,
[GetHashKey('BOXVILLE3')] = true,
[GetHashKey('BOXVILLE4')] = true,
[GetHashKey('BOXVILLE5')] = true,
[GetHashKey('BURRITO')] = true,
[GetHashKey('BURRITO2')] = true,
[GetHashKey('BURRITO3')] = true,
[GetHashKey('BURRITO4')] = true,
[GetHashKey('BURRITO5')] = true,
[GetHashKey('CAMPER')] = true,
[GetHashKey('GBURRITO')] = true,
[GetHashKey('GBURRITO2')] = true,
[GetHashKey('JOURNEY')] = true,
[GetHashKey('MINIVAN')] = true,
[GetHashKey('MINIVAN2')] = true,
[GetHashKey('PARADISE')] = true,
[GetHashKey('PONY')] = true,
[GetHashKey('PONY2')] = true,
[GetHashKey('RUMPO')] = true,
[GetHashKey('RUMPO2')] = true,
[GetHashKey('RUMPO3')] = true,
[GetHashKey('SPEEDO')] = true,
[GetHashKey('SPEEDO2')] = true,
[GetHashKey('SPEEDO4')] = true,
[GetHashKey('SURFER')] = true,
[GetHashKey('SURFER2')] = true,
[GetHashKey('TACO')] = true,
[GetHashKey('YOUGA')] = true,
[GetHashKey('YOUGA2')] = true,
[GetHashKey('YOUGA2')] = true,
[GetHashKey('AIRTUG')] = true,
[GetHashKey('CADDY')] = true,
[GetHashKey('CADDY2')] = true,
[GetHashKey('CADDY3')] = true,
[GetHashKey('DOCKTUG')] = true,
[GetHashKey('FORKLIFT')] = true,
[GetHashKey('MOWER')] = true,
[GetHashKey('RIPLEY')] = true,
[GetHashKey('SADLER')] = true,
[GetHashKey('SADLER2')] = true,
[GetHashKey('SCRAP')] = true,
[GetHashKey('TOWTRUCK')] = true,
[GetHashKey('TOWTRUCK2')] = true,
[GetHashKey('TRACTOR')] = true,
[GetHashKey('TRACTOR2')] = true,
[GetHashKey('TRACTOR3')] = true,
[GetHashKey('UTILLITRUCK')] = true,
[GetHashKey('UTILLITRUCK2')] = true,
[GetHashKey('UTILLITRUCK3')] = true,
--SEDANS
[GetHashKey('ASEA')] = true,
[GetHashKey('ASEA2')] = true,
[GetHashKey('ASTEROPE')] = true,
[GetHashKey('COG55')] = true,
[GetHashKey('COG552')] = true,
[GetHashKey('COGNOSCENTI')] = true,
[GetHashKey('COGNOSCENTI2')] = true,
[GetHashKey('EMPEROR')] = true,
[GetHashKey('EMPEROR2')] = true,
[GetHashKey('EMPEROR3')] = true,
[GetHashKey('FUGITIVE')] = true,
[GetHashKey('GLENDALE')] = true,
[GetHashKey('INGOT')] = true,
[GetHashKey('INTRUDER')] = true,
[GetHashKey('LIMO2')] = true,
[GetHashKey('PREMIER')] = true,
[GetHashKey('PRIMO')] = true,
[GetHashKey('PRIMO2')] = true,
[GetHashKey('REGINA')] = true,
[GetHashKey('ROMERO')] = true,
[GetHashKey('STAFFORD')] = true,
[GetHashKey('STANIER')] = true,
[GetHashKey('STRATUM')] = true,
[GetHashKey('STRETCH')] = true,
[GetHashKey('SUPERD')] = true,
[GetHashKey('SURGE')] = true,
[GetHashKey('TAILGATER')] = true,
[GetHashKey('WARRENER')] = true,
[GetHashKey('WASHINGTON')] = true,
--SUVS
[GetHashKey('BALLER')] = true,
[GetHashKey('BALLER2')] = true,
[GetHashKey('BALLER3')] = true,
[GetHashKey('BALLER4')] = true,
[GetHashKey('BALLER5')] = true,
[GetHashKey('BALLER6')] = true,
[GetHashKey('BJXL')] = true,
[GetHashKey('CAVALCADE')] = true,
[GetHashKey('CAVALCADE2')] = true,
[GetHashKey('CONTENDER')] = true,
[GetHashKey('DUBSTA')] = true,
[GetHashKey('DUBSTA2')] = true,
[GetHashKey('FQ2')] = true,
[GetHashKey('GRANGER')] = true,
[GetHashKey('GRESLEY')] = true,
[GetHashKey('HABANERO')] = true,
[GetHashKey('HUNTLEY')] = true,
[GetHashKey('LANDSTALKER')] = true,
[GetHashKey('MESA')] = true,
[GetHashKey('MESA2')] = true,
[GetHashKey('NOVAK')] = true,
[GetHashKey('PATRIOT')] = true,
[GetHashKey('PATRIOT2')] = true,
[GetHashKey('RADI')] = true,
[GetHashKey('REBLA')] = true,
[GetHashKey('ROCOTO')] = true,
[GetHashKey('SEMINOLE')] = true,
[GetHashKey('SERRANO')] = true,
[GetHashKey('TOROS')] = true,
[GetHashKey('XLS')] = true,
[GetHashKey('XLS2')] = true,
--OFFROAD
[GetHashKey('BFINJECTION')] = true,
[GetHashKey('BIFTA')] = true,
[GetHashKey('BLAZER')] = true,
[GetHashKey('BLAZER2')] = true,
[GetHashKey('BLAZER3')] = true,
[GetHashKey('BLAZER4')] = true,
[GetHashKey('BLAZER5')] = true,
[GetHashKey('BODHI2')] = true,
[GetHashKey('BRAWLER')] = true,
[GetHashKey('BRUISER')] = true,
[GetHashKey('BRUISER2')] = true,
[GetHashKey('BRUISER3')] = true,
[GetHashKey('BRUTUS')] = true,
[GetHashKey('BRUTUS2')] = true,
[GetHashKey('BRUTUS3')] = true,
[GetHashKey('CARACARA')] = true,
[GetHashKey('CARACARA2')] = true,
[GetHashKey('DLOADER')] = true,
[GetHashKey('DUBSTA3')] = true,
[GetHashKey('DUNE')] = true,
[GetHashKey('DUNE2')] = true,
[GetHashKey('DUNE3')] = true,
[GetHashKey('DUNE4')] = true,
[GetHashKey('DUNE5')] = true,
[GetHashKey('EVERON')] = true,
[GetHashKey('FREECRAWLER')] = true,
[GetHashKey('HELLION')] = true,
[GetHashKey('INSURGENT')] = true,
[GetHashKey('INSURGENT2')] = true,
[GetHashKey('INSURGENT3')] = true,
[GetHashKey('KALAHARI')] = true,
[GetHashKey('KAMACHO')] = true,
[GetHashKey('MARSHALL')] = true,
[GetHashKey('MESA3')] = true,
[GetHashKey('MONSTER')] = true,
[GetHashKey('MONSTER3')] = true,
[GetHashKey('MONSTER4')] = true,
[GetHashKey('MONSTER5')] = true,
[GetHashKey('MENACER')] = true,
[GetHashKey('OUTLAW')] = true,
[GetHashKey('NIGHTSHARK')] = true,
[GetHashKey('RANCHERXL')] = true,
[GetHashKey('RANCHERXL2')] = true,
[GetHashKey('REBEL')] = true,
[GetHashKey('REBEL2')] = true,
[GetHashKey('RCBANDITO')] = true,
[GetHashKey('RIATA')] = true,
[GetHashKey('SANDKING')] = true,
[GetHashKey('SANDKING2')] = true,
[GetHashKey('TECHNICAL')] = true,
[GetHashKey('TECHNICAL2')] = true,
[GetHashKey('TECHNICAL3')] = true,
[GetHashKey('TROPHYTRUCK')] = true,
[GetHashKey('TROPHYTRUCK2')] = true,
[GetHashKey('VAGRANT')] = true,
[GetHashKey('ZHABA')] = true,
--INDUSTRIAL
[GetHashKey('BULLDOZER')] = true,
[GetHashKey('CUTTER')] = true,
[GetHashKey('DUMP')] = true,
[GetHashKey('FLATBED')] = true,
[GetHashKey('GUARDIAN')] = true,
[GetHashKey('HANDLER')] = true,
[GetHashKey('MIXER')] = true,
[GetHashKey('MIXER2')] = true,
[GetHashKey('RUBBLE')] = true,
[GetHashKey('TIPTRUCK')] = true,
[GetHashKey('TIPTRUCK2')] = true,
--COMPACTS
[GetHashKey('ASBO')] = true,
[GetHashKey('BLISTA')] = true,
[GetHashKey('BRIOSO')] = true,
[GetHashKey('DILETTANTE')] = true,
[GetHashKey('DILETTANTE2')] = true,
[GetHashKey('KANJO')] = true,
[GetHashKey('ISSI2')] = true,
[GetHashKey('ISSI3')] = true,
[GetHashKey('ISSI4')] = true,
[GetHashKey('ISSI5')] = true,
[GetHashKey('ISSI6')] = true,
[GetHashKey('PANTO')] = true,
[GetHashKey('PRAIRIE')] = true,
[GetHashKey('RHAPSODY')] = true,
--COMMERCIALS
[GetHashKey('BENSON')] = true,
[GetHashKey('BIFF')] = true,
[GetHashKey('CERBERUS')] = true,
[GetHashKey('CERBERUS2')] = true,
[GetHashKey('CERBERUS3')] = true,
[GetHashKey('HAULER')] = true,
[GetHashKey('HAULER2')] = true,
[GetHashKey('MULE')] = true,
[GetHashKey('MULE2')] = true,
[GetHashKey('MULE3')] = true,
[GetHashKey('MULE4')] = true,
[GetHashKey('PACKER')] = true,
[GetHashKey('PHANTOM')] = true,
[GetHashKey('PHANTOM2')] = true,
[GetHashKey('PHANTOM3')] = true,
[GetHashKey('POUNDER')] = true,
[GetHashKey('POUNDER2')] = true,
[GetHashKey('STOCKADE')] = true,
[GetHashKey('STOCKADE3')] = true,
[GetHashKey('TERBYTE')] = true
}
-- TODO: Replace with `FLAG_IS_ELECTRIC` from vehicles.meta:
-- https://gtamods.com/wiki/Vehicles.meta
function IsVehicleElectric(vehicle)
local model = GetEntityModel(vehicle)
return ELECTRIC_VEHICLES[model] or false
end