From 4774170e3040085ddaaed566210c3a5a774a67a2 Mon Sep 17 00:00:00 2001 From: Jordan Dalton Date: Sat, 6 Jan 2018 11:42:16 +0000 Subject: [PATCH] feat: add reverse_car_hashes Car names can now be reversed to their English names. You can change this by modifying the "reverse_car_hashes.lua" file. Also added a check to the reverse hash functions to make sure the hash being passed is a string. --- __resource.lua | 4 +- client/reverse_car_hashes.lua | 475 +++++++++++++++++++++++++++++++ client/reverse_weapon_hashes.lua | 4 + 3 files changed, 482 insertions(+), 1 deletion(-) create mode 100644 client/reverse_car_hashes.lua diff --git a/__resource.lua b/__resource.lua index 0392e3e..6288ae9 100644 --- a/__resource.lua +++ b/__resource.lua @@ -3,11 +3,13 @@ resource_manifest_version "44febabe-d386-4d18-afbe-5e627f4af937" client_scripts{ "client/client.lua", "client/reverse_weapon_hashes.lua", + "client/reverse_car_hashes.lua", "client/blips_client.lua" } exports{ - "reverseWeaponHash" + "reverseWeaponHash", + "reverseVehicleHash" } server_scripts{ diff --git a/client/reverse_car_hashes.lua b/client/reverse_car_hashes.lua new file mode 100644 index 0000000..090fe77 --- /dev/null +++ b/client/reverse_car_hashes.lua @@ -0,0 +1,475 @@ +--[[ + LiveMap - A LiveMap for FiveM servers + Copyright (C) 2017 Jordan Dalton + +You should have received a copy of the GNU General Public License +along with this program in the file "LICENSE". If not, see . +]] +local VEHICLE_HASHES = { + [tostring(GetHashKey("adder"))] = "Adder", + [tostring(GetHashKey("airbus"))] = "Airport Bus", + [tostring(GetHashKey("airtug"))] = "Airtug", + [tostring(GetHashKey("akuma"))] = "Akuma", + [tostring(GetHashKey("alpha"))] = "Alpha", + [tostring(GetHashKey("ambulance"))] = "Ambulance", + [tostring(GetHashKey("annihilator"))] = "Annihilator", + [tostring(GetHashKey("armytanker"))] = "Army Trailer", + [tostring(GetHashKey("armytrailer"))] = "Army Trailer", + [tostring(GetHashKey("armytrailer2"))] = "Army Trailer", + [tostring(GetHashKey("asea"))] = "Asea", + [tostring(GetHashKey("asea2"))] = "Asea", + [tostring(GetHashKey("asterope"))] = "Asterope", + [tostring(GetHashKey("bagger"))] = "Bagger", + [tostring(GetHashKey("baletrailer"))] = "Baletrailer", + [tostring(GetHashKey("baller"))] = "Baller", + [tostring(GetHashKey("baller2"))] = "Baller", + [tostring(GetHashKey("baller3"))] = "Baller LE", + [tostring(GetHashKey("baller4"))] = "Baller LE LWB", + [tostring(GetHashKey("baller5"))] = "Baller LE (Armored)", + [tostring(GetHashKey("baller6"))] = "Baller LE LWB (Armored)", + [tostring(GetHashKey("banshee"))] = "Banshee", + [tostring(GetHashKey("banshee2"))] = "Banshee 900R", + [tostring(GetHashKey("barracks"))] = "Barracks", + [tostring(GetHashKey("barracks2"))] = "Barracks Semi", + [tostring(GetHashKey("barracks3"))] = "Barracks", + [tostring(GetHashKey("bati"))] = "Bati 801", + [tostring(GetHashKey("bati2"))] = "Bati 801RR", + [tostring(GetHashKey("benson"))] = "Benson", + [tostring(GetHashKey("besra"))] = "Besra", + [tostring(GetHashKey("bestiagts"))] = "Bestia GTS", + [tostring(GetHashKey("bf400"))] = "BF400", + [tostring(GetHashKey("bfinjection"))] = "Injection", + [tostring(GetHashKey("biff"))] = "Biff", + [tostring(GetHashKey("bifta"))] = "Bifta", + [tostring(GetHashKey("bison"))] = "Bison", + [tostring(GetHashKey("bison2"))] = "Bison", + [tostring(GetHashKey("bison3"))] = "Bison", + [tostring(GetHashKey("bjxl"))] = "BeeJay XL", + [tostring(GetHashKey("blade"))] = "Blade", + [tostring(GetHashKey("blazer"))] = "Blazer", + [tostring(GetHashKey("blazer2"))] = "Blazer Lifeguard", + [tostring(GetHashKey("blazer3"))] = "Hot Rod Blazer", + [tostring(GetHashKey("blimp"))] = "Atomic Blimp", + [tostring(GetHashKey("blimp2"))] = "Xero Blimp", + [tostring(GetHashKey("blista"))] = "Blista", + [tostring(GetHashKey("blista2"))] = "Blista Compact", + [tostring(GetHashKey("blista3"))] = "Go Go Monkey Blista", + [tostring(GetHashKey("bmx"))] = "BMX", + [tostring(GetHashKey("boattrailer"))] = "Boat Trailer", + [tostring(GetHashKey("bobcatxl"))] = "Bobcat XL", + [tostring(GetHashKey("bodhi2"))] = "Bodhi", + [tostring(GetHashKey("boxville"))] = "Boxville", + [tostring(GetHashKey("boxville2"))] = "Boxville", + [tostring(GetHashKey("boxville3"))] = "Boxville", + [tostring(GetHashKey("boxville4"))] = "Boxville", + [tostring(GetHashKey("brawler"))] = "Brawler", + [tostring(GetHashKey("brickade"))] = "Brickade", + [tostring(GetHashKey("brioso"))] = "Brioso R/A", + [tostring(GetHashKey("btype"))] = "Roosevelt", + [tostring(GetHashKey("btype2"))] = "Fränken Stange", + [tostring(GetHashKey("btype3"))] = "Roosevelt Valor", + [tostring(GetHashKey("buccaneer"))] = "Buccaneer", + [tostring(GetHashKey("buccaneer2"))] = "Buccaneer Custom", + [tostring(GetHashKey("buffalo"))] = "Buffalo", + [tostring(GetHashKey("buffalo2"))] = "Buffalo S", + [tostring(GetHashKey("buffalo3"))] = "Sprunk Buffalo", + [tostring(GetHashKey("bulldozer"))] = "Dozer", + [tostring(GetHashKey("bullet"))] = "Bullet", + [tostring(GetHashKey("burrito"))] = "Burrito", + [tostring(GetHashKey("burrito2"))] = "Burrito", + [tostring(GetHashKey("burrito3"))] = "Burrito", + [tostring(GetHashKey("burrito4"))] = "Burrito", + [tostring(GetHashKey("burrito5"))] = "Burrito", + [tostring(GetHashKey("bus"))] = "Bus", + [tostring(GetHashKey("buzzard"))] = "Buzzard Attack Chopper", + [tostring(GetHashKey("buzzard2"))] = "Buzzard", + [tostring(GetHashKey("cablecar"))] = "Cable Car", + [tostring(GetHashKey("caddy"))] = "Caddy", + [tostring(GetHashKey("caddy2"))] = "Caddy", + [tostring(GetHashKey("camper"))] = "Camper", + [tostring(GetHashKey("carbonizzare"))] = "Carbonizzare", + [tostring(GetHashKey("carbonrs"))] = "Carbon RS", + [tostring(GetHashKey("cargobob"))] = "Cargobob", + [tostring(GetHashKey("cargobob2"))] = "Cargobob", + [tostring(GetHashKey("cargobob3"))] = "Cargobob", + [tostring(GetHashKey("cargobob4"))] = "Cargobob", + [tostring(GetHashKey("cargoplane"))] = "Cargo Plane", + [tostring(GetHashKey("casco"))] = "Casco", + [tostring(GetHashKey("cavalcade"))] = "Cavalcade", + [tostring(GetHashKey("cavalcade2"))] = "Cavalcade", + [tostring(GetHashKey("cheetah"))] = "Cheetah", + [tostring(GetHashKey("chino"))] = "Chino", + [tostring(GetHashKey("chino2"))] = "Chino Custom", + [tostring(GetHashKey("cliffhanger"))] = "Cliffhanger", + [tostring(GetHashKey("coach"))] = "Dashound", + [tostring(GetHashKey("cog55"))] = "Cognoscenti 55", + [tostring(GetHashKey("cog552"))] = "Cognoscenti 55 (Armored)", + [tostring(GetHashKey("cogcabrio"))] = "Cognoscenti Cabrio", + [tostring(GetHashKey("cognoscenti"))] = "Cognoscenti", + [tostring(GetHashKey("cognoscenti2"))] = "Cognoscenti (Armored)", + [tostring(GetHashKey("comet2"))] = "Comet", + [tostring(GetHashKey("contender"))] = "Contender", + [tostring(GetHashKey("coquette"))] = "Coquette", + [tostring(GetHashKey("coquette2"))] = "Coquette Classic", + [tostring(GetHashKey("coquette3"))] = "Coquette BlackFin", + [tostring(GetHashKey("cruiser"))] = "Cruiser", + [tostring(GetHashKey("crusader"))] = "Crusader", + [tostring(GetHashKey("cuban800"))] = "Cuban 800", + [tostring(GetHashKey("cutter"))] = "Cutter", + [tostring(GetHashKey("daemon"))] = "Daemon", + [tostring(GetHashKey("dilettante"))] = "Dilettante", + [tostring(GetHashKey("dilettante2"))] = "Dilettante", + [tostring(GetHashKey("dinghy"))] = "Dinghy", + [tostring(GetHashKey("dinghy2"))] = "Dinghy", + [tostring(GetHashKey("dinghy3"))] = "Dinghy", + [tostring(GetHashKey("dinghy4"))] = "Dinghy", + [tostring(GetHashKey("dloader"))] = "Duneloader", + [tostring(GetHashKey("docktrailer"))] = "NULL", + [tostring(GetHashKey("docktug"))] = "Docktug", + [tostring(GetHashKey("dodo"))] = "Dodo", + [tostring(GetHashKey("dominator"))] = "Dominator", + [tostring(GetHashKey("dominator2"))] = "Pisswasser Dominator", + [tostring(GetHashKey("double"))] = "Double-T", + [tostring(GetHashKey("dubsta"))] = "Dubsta", + [tostring(GetHashKey("dubsta2"))] = "Dubsta", + [tostring(GetHashKey("dubsta3"))] = "Dubsta 6x6", + [tostring(GetHashKey("dukes"))] = "Dukes", + [tostring(GetHashKey("dukes2"))] = "Duke O'Death", + [tostring(GetHashKey("dump"))] = "Dump", + [tostring(GetHashKey("dune"))] = "Dune Buggy", + [tostring(GetHashKey("dune2"))] = "Space Docker", + [tostring(GetHashKey("duster"))] = "Duster", + [tostring(GetHashKey("elegy2"))] = "Elegy RH8", + [tostring(GetHashKey("emperor"))] = "Emperor", + [tostring(GetHashKey("emperor2"))] = "Emperor", + [tostring(GetHashKey("emperor3"))] = "Emperor", + [tostring(GetHashKey("enduro"))] = "Enduro", + [tostring(GetHashKey("entityxf"))] = "Entity XF", + [tostring(GetHashKey("exemplar"))] = "Exemplar", + [tostring(GetHashKey("f620"))] = "F620", + [tostring(GetHashKey("faction"))] = "Faction", + [tostring(GetHashKey("faction2"))] = "Faction Custom", + [tostring(GetHashKey("faction3"))] = "Faction Custom Donk", + [tostring(GetHashKey("faggio2"))] = "Faggio", + [tostring(GetHashKey("fbi"))] = "FIB", + [tostring(GetHashKey("fbi2"))] = "FIB", + [tostring(GetHashKey("felon"))] = "Felon", + [tostring(GetHashKey("felon2"))] = "Felon GT", + [tostring(GetHashKey("feltzer2"))] = "Feltzer", + [tostring(GetHashKey("feltzer3"))] = "Stirling GT", + [tostring(GetHashKey("firetruk"))] = "Fire Truck", + [tostring(GetHashKey("fixter"))] = "Fixter", + [tostring(GetHashKey("flatbed"))] = "Flatbed", + [tostring(GetHashKey("fmj"))] = "FMJ", + [tostring(GetHashKey("forklift"))] = "Forklift", + [tostring(GetHashKey("fq2"))] = "FQ 2", + [tostring(GetHashKey("freight"))] = "Freight Train", + [tostring(GetHashKey("freightcar"))] = "Freight Train", + [tostring(GetHashKey("freightcont1"))] = "Freight Train", + [tostring(GetHashKey("freightcont2"))] = "Freight Train", + [tostring(GetHashKey("freightgrain"))] = "Freight Train", + [tostring(GetHashKey("freighttrailer"))] = "NULL", + [tostring(GetHashKey("frogger"))] = "Frogger", + [tostring(GetHashKey("frogger2"))] = "Frogger", + [tostring(GetHashKey("fugitive"))] = "Fugitive", + [tostring(GetHashKey("furoregt"))] = "Furore GT", + [tostring(GetHashKey("fusilade"))] = "Fusilade", + [tostring(GetHashKey("futo"))] = "Futo", + [tostring(GetHashKey("gargoyle"))] = "Gargoyle", + [tostring(GetHashKey("gauntlet"))] = "Gauntlet", + [tostring(GetHashKey("gauntlet2"))] = "Redwood Gauntlet", + [tostring(GetHashKey("gburrito"))] = "Gang Burrito", + [tostring(GetHashKey("gburrito2"))] = "Gang Burrito", + [tostring(GetHashKey("glendale"))] = "Glendale", + [tostring(GetHashKey("graintrailer"))] = "NULL", + [tostring(GetHashKey("granger"))] = "Granger", + [tostring(GetHashKey("gresley"))] = "Gresley", + [tostring(GetHashKey("guardian"))] = "Guardian", + [tostring(GetHashKey("habanero"))] = "Habanero", + [tostring(GetHashKey("hakuchou"))] = "Hakuchou", + [tostring(GetHashKey("handler"))] = "Dock Handler", + [tostring(GetHashKey("hauler"))] = "Hauler", + [tostring(GetHashKey("hexer"))] = "Hexer", + [tostring(GetHashKey("hotknife"))] = "Hotknife", + [tostring(GetHashKey("huntley"))] = "Huntley S", + [tostring(GetHashKey("hydra"))] = "Hydra", + [tostring(GetHashKey("infernus"))] = "Infernus", + [tostring(GetHashKey("ingot"))] = "Ingot", + [tostring(GetHashKey("innovation"))] = "Innovation", + [tostring(GetHashKey("insurgent"))] = "Insurgent Pick-Up", + [tostring(GetHashKey("insurgent2"))] = "Insurgent", + [tostring(GetHashKey("intruder"))] = "Intruder", + [tostring(GetHashKey("issi2"))] = "Issi", + [tostring(GetHashKey("jackal"))] = "Jackal", + [tostring(GetHashKey("jb700"))] = "JB 700", + [tostring(GetHashKey("jester"))] = "Jester", + [tostring(GetHashKey("jester2"))] = "Jester (Racecar)", + [tostring(GetHashKey("jet"))] = "Jet", + [tostring(GetHashKey("jetmax"))] = "Jetmax", + [tostring(GetHashKey("journey"))] = "Journey", + [tostring(GetHashKey("kalahari"))] = "Kalahari", + [tostring(GetHashKey("khamelion"))] = "Khamelion", + [tostring(GetHashKey("kuruma"))] = "Kuruma", + [tostring(GetHashKey("kuruma2"))] = "Kuruma (Armored)", + [tostring(GetHashKey("landstalker"))] = "Landstalker", + [tostring(GetHashKey("lazer"))] = "P-996 LAZER", + [tostring(GetHashKey("le7b"))] = "RE-7B", + [tostring(GetHashKey("lectro"))] = "Lectro", + [tostring(GetHashKey("lguard"))] = "Lifeguard", + [tostring(GetHashKey("limo2"))] = "Turreted Limo", + [tostring(GetHashKey("lurcher"))] = "Lurcher", + [tostring(GetHashKey("luxor"))] = "Luxor", + [tostring(GetHashKey("luxor2"))] = "Luxor Deluxe", + [tostring(GetHashKey("lynx"))] = "Lynx", + [tostring(GetHashKey("mamba"))] = "Mamba", + [tostring(GetHashKey("mammatus"))] = "Mammatus", + [tostring(GetHashKey("manana"))] = "Manana", + [tostring(GetHashKey("marquis"))] = "Marquis", + [tostring(GetHashKey("marshall"))] = "Marshall", + [tostring(GetHashKey("massacro"))] = "Massacro", + [tostring(GetHashKey("massacro2"))] = "Massacro (Racecar)", + [tostring(GetHashKey("maverick"))] = "Maverick", + [tostring(GetHashKey("mesa"))] = "Mesa", + [tostring(GetHashKey("mesa2"))] = "Mesa", + [tostring(GetHashKey("mesa3"))] = "Mesa", + [tostring(GetHashKey("metrotrain"))] = "Freight Train", + [tostring(GetHashKey("miljet"))] = "Miljet", + [tostring(GetHashKey("minivan"))] = "Minivan", + [tostring(GetHashKey("minivan2"))] = "Minivan Custom", + [tostring(GetHashKey("mixer"))] = "Mixer", + [tostring(GetHashKey("mixer2"))] = "Mixer", + [tostring(GetHashKey("monroe"))] = "Monroe", + [tostring(GetHashKey("monster"))] = "Liberator", + [tostring(GetHashKey("moonbeam"))] = "Moonbeam", + [tostring(GetHashKey("moonbeam2"))] = "Moonbeam Custom", + [tostring(GetHashKey("mower"))] = "Lawn Mower", + [tostring(GetHashKey("mule"))] = "Mule", + [tostring(GetHashKey("mule2"))] = "Mule", + [tostring(GetHashKey("mule3"))] = "Mule", + [tostring(GetHashKey("nemesis"))] = "Nemesis", + [tostring(GetHashKey("nightshade"))] = "Nightshade", + [tostring(GetHashKey("nimbus"))] = "Nimbus", + [tostring(GetHashKey("ninef"))] = "9F", + [tostring(GetHashKey("ninef2"))] = "9F Cabrio", + [tostring(GetHashKey("omnis"))] = "Omnis", + [tostring(GetHashKey("oracle"))] = "Oracle XS", + [tostring(GetHashKey("oracle2"))] = "Oracle", + [tostring(GetHashKey("osiris"))] = "Osiris", + [tostring(GetHashKey("packer"))] = "Packer", + [tostring(GetHashKey("panto"))] = "Panto", + [tostring(GetHashKey("paradise"))] = "Paradise", + [tostring(GetHashKey("patriot"))] = "Patriot", + [tostring(GetHashKey("pbus"))] = "Prison Bus", + [tostring(GetHashKey("pcj"))] = "PCJ 600", + [tostring(GetHashKey("penumbra"))] = "Penumbra", + [tostring(GetHashKey("peyote"))] = "Peyote", + [tostring(GetHashKey("pfister811"))] = "811", + [tostring(GetHashKey("phantom"))] = "Phantom", + [tostring(GetHashKey("phoenix"))] = "Phoenix", + [tostring(GetHashKey("picador"))] = "Picador", + [tostring(GetHashKey("pigalle"))] = "Pigalle", + [tostring(GetHashKey("police"))] = "Police Cruiser", + [tostring(GetHashKey("police2"))] = "Police Cruiser", + [tostring(GetHashKey("police3"))] = "Police Cruiser", + [tostring(GetHashKey("police4"))] = "Unmarked Cruiser", + [tostring(GetHashKey("policeb"))] = "Police Bike", + [tostring(GetHashKey("policeold1"))] = "Police Rancher", + [tostring(GetHashKey("policeold2"))] = "Police Roadcruiser", + [tostring(GetHashKey("policet"))] = "Police Transporter", + [tostring(GetHashKey("polmav"))] = "Police Maverick", + [tostring(GetHashKey("pony"))] = "Pony", + [tostring(GetHashKey("pony2"))] = "Pony", + [tostring(GetHashKey("pounder"))] = "Pounder", + [tostring(GetHashKey("prairie"))] = "Prairie", + [tostring(GetHashKey("pranger"))] = "Park Ranger", + [tostring(GetHashKey("predator"))] = "Police Predator", + [tostring(GetHashKey("premier"))] = "Premier", + [tostring(GetHashKey("primo"))] = "Primo", + [tostring(GetHashKey("primo2"))] = "Primo Custom", + [tostring(GetHashKey("proptrailer"))] = "NULL", + [tostring(GetHashKey("prototipo"))] = "X80 Proto", + [tostring(GetHashKey("radi"))] = "Radius", + [tostring(GetHashKey("raketrailer"))] = "Trailer", + [tostring(GetHashKey("rallytruck"))] = "Dune", + [tostring(GetHashKey("rancherxl"))] = "Rancher XL", + [tostring(GetHashKey("rancherxl2"))] = "Rancher XL", + [tostring(GetHashKey("rapidgt"))] = "Rapid GT", + [tostring(GetHashKey("rapidgt2"))] = "Rapid GT", + [tostring(GetHashKey("ratloader"))] = "Rat-Loader", + [tostring(GetHashKey("ratloader2"))] = "Rat-Truck", + [tostring(GetHashKey("reaper"))] = "Reaper", + [tostring(GetHashKey("rebel"))] = "Rusty Rebel", + [tostring(GetHashKey("rebel2"))] = "Rebel", + [tostring(GetHashKey("regina"))] = "Regina", + [tostring(GetHashKey("rentalbus"))] = "Rental Shuttle Bus", + [tostring(GetHashKey("rhapsody"))] = "Rhapsody", + [tostring(GetHashKey("rhino"))] = "Rhino Tank", + [tostring(GetHashKey("riot"))] = "Police Riot", + [tostring(GetHashKey("ripley"))] = "Ripley", + [tostring(GetHashKey("rocoto"))] = "Rocoto", + [tostring(GetHashKey("romero"))] = "Romero Hearse", + [tostring(GetHashKey("rubble"))] = "Rubble", + [tostring(GetHashKey("ruffian"))] = "Ruffian", + [tostring(GetHashKey("ruiner"))] = "Ruiner", + [tostring(GetHashKey("rumpo"))] = "Rumpo", + [tostring(GetHashKey("rumpo2"))] = "Rumpo", + [tostring(GetHashKey("rumpo3"))] = "Rumpo Custom", + [tostring(GetHashKey("sabregt"))] = "Sabre Turbo", + [tostring(GetHashKey("sabregt2"))] = "Sabre Turbo Custom", + [tostring(GetHashKey("sadler"))] = "Sadler", + [tostring(GetHashKey("sadler2"))] = "Sadler", + [tostring(GetHashKey("sanchez"))] = "Sanchez (livery)", + [tostring(GetHashKey("sanchez2"))] = "Sanchez", + [tostring(GetHashKey("sandking"))] = "Sandking XL", + [tostring(GetHashKey("sandking2"))] = "Sandking SWB", + [tostring(GetHashKey("savage"))] = "Savage", + [tostring(GetHashKey("schafter2"))] = "Schafter", + [tostring(GetHashKey("schafter3"))] = "Schafter V12", + [tostring(GetHashKey("schafter4"))] = "Schafter LWB", + [tostring(GetHashKey("schafter5"))] = "Schafter V12 (Armored)", + [tostring(GetHashKey("schafter6"))] = "Schafter LWB (Armored)", + [tostring(GetHashKey("schwarzer"))] = "Schwartzer", + [tostring(GetHashKey("scorcher"))] = "Scorcher", + [tostring(GetHashKey("scrap"))] = "Scrap Truck", + [tostring(GetHashKey("seashark"))] = "Seashark", + [tostring(GetHashKey("seashark2"))] = "Seashark", + [tostring(GetHashKey("seashark3"))] = "Seashark", + [tostring(GetHashKey("seminole"))] = "Seminole", + [tostring(GetHashKey("sentinel"))] = "Sentinel XS", + [tostring(GetHashKey("sentinel2"))] = "Sentinel", + [tostring(GetHashKey("serrano"))] = "Serrano", + [tostring(GetHashKey("seven70"))] = "Seven-70", + [tostring(GetHashKey("shamal"))] = "Shamal", + [tostring(GetHashKey("sheava"))] = "ETR1", + [tostring(GetHashKey("sheriff"))] = "Sheriff Cruiser", + [tostring(GetHashKey("sheriff2"))] = "Sheriff SUV", + [tostring(GetHashKey("skylift"))] = "Skylift", + [tostring(GetHashKey("slamvan"))] = "Slamvan", + [tostring(GetHashKey("slamvan2"))] = "Lost Slamvan", + [tostring(GetHashKey("slamvan3"))] = "Slamvan Custom", + [tostring(GetHashKey("sovereign"))] = "Sovereign", + [tostring(GetHashKey("speeder"))] = "Speeder", + [tostring(GetHashKey("speeder2"))] = "Speeder", + [tostring(GetHashKey("speedo"))] = "Speedo", + [tostring(GetHashKey("speedo2"))] = "Clown Van", + [tostring(GetHashKey("squalo"))] = "Squalo", + [tostring(GetHashKey("stalion"))] = "Stallion", + [tostring(GetHashKey("stalion2"))] = "Burger Shot Stallion", + [tostring(GetHashKey("stanier"))] = "Stanier", + [tostring(GetHashKey("stinger"))] = "Stinger", + [tostring(GetHashKey("stingergt"))] = "Stinger GT", + [tostring(GetHashKey("stockade"))] = "Stockade", + [tostring(GetHashKey("stockade3"))] = "Stockade", + [tostring(GetHashKey("stratum"))] = "Stratum", + [tostring(GetHashKey("stretch"))] = "Stretch", + [tostring(GetHashKey("stunt"))] = "Mallard", + [tostring(GetHashKey("submersible"))] = "Submersible", + [tostring(GetHashKey("submersible2"))] = "Kraken", + [tostring(GetHashKey("sultan"))] = "Sultan", + [tostring(GetHashKey("sultanrs"))] = "Sultan RS", + [tostring(GetHashKey("suntrap"))] = "Suntrap", + [tostring(GetHashKey("superd"))] = "Super Diamond", + [tostring(GetHashKey("supervolito"))] = "SuperVolito", + [tostring(GetHashKey("supervolito2"))] = "SuperVolito Carbon", + [tostring(GetHashKey("surano"))] = "Surano", + [tostring(GetHashKey("surfer"))] = "Surfer", + [tostring(GetHashKey("surfer2"))] = "Surfer", + [tostring(GetHashKey("surge"))] = "Surge", + [tostring(GetHashKey("swift"))] = "Swift", + [tostring(GetHashKey("swift2"))] = "Swift Deluxe", + [tostring(GetHashKey("t20"))] = "T20", + [tostring(GetHashKey("taco"))] = "Taco Van", + [tostring(GetHashKey("tailgater"))] = "Tailgater", + [tostring(GetHashKey("tampa"))] = "Tampa", + [tostring(GetHashKey("tampa2"))] = "Drift Tampa", + [tostring(GetHashKey("tanker"))] = "Trailer", + [tostring(GetHashKey("tanker2"))] = "NULL", + [tostring(GetHashKey("tankercar"))] = "Freight Train", + [tostring(GetHashKey("taxi"))] = "Taxi", + [tostring(GetHashKey("technical"))] = "Technical", + [tostring(GetHashKey("thrust"))] = "Thrust", + [tostring(GetHashKey("tiptruck"))] = "Tipper", + [tostring(GetHashKey("tiptruck2"))] = "Tipper", + [tostring(GetHashKey("titan"))] = "Titan", + [tostring(GetHashKey("tornado"))] = "Tornado", + [tostring(GetHashKey("tornado2"))] = "Tornado", + [tostring(GetHashKey("tornado3"))] = "Tornado", + [tostring(GetHashKey("tornado4"))] = "Tornado", + [tostring(GetHashKey("tornado5"))] = "Tornado Custom", + [tostring(GetHashKey("toro"))] = "Toro", + [tostring(GetHashKey("toro2"))] = "Toro", + [tostring(GetHashKey("tourbus"))] = "Tourbus", + [tostring(GetHashKey("towtruck"))] = "Towtruck", + [tostring(GetHashKey("towtruck2"))] = "Towtruck", + [tostring(GetHashKey("tr2"))] = "Trailer", + [tostring(GetHashKey("tr3"))] = "Trailer", + [tostring(GetHashKey("tr4"))] = "Trailer", + [tostring(GetHashKey("tractor"))] = "Tractor", + [tostring(GetHashKey("tractor2"))] = "Fieldmaster", + [tostring(GetHashKey("tractor3"))] = "Fieldmaster", + [tostring(GetHashKey("trailerlogs"))] = "Trailer", + [tostring(GetHashKey("trailers"))] = "Trailer", + [tostring(GetHashKey("trailers2"))] = "Trailer", + [tostring(GetHashKey("trailers3"))] = "Trailer", + [tostring(GetHashKey("trailersmall"))] = "Trailer", + [tostring(GetHashKey("trash"))] = "Trashmaster", + [tostring(GetHashKey("trash2"))] = "Trashmaster", + [tostring(GetHashKey("trflat"))] = "Trailer", + [tostring(GetHashKey("tribike"))] = "Whippet Race Bike", + [tostring(GetHashKey("tribike2"))] = "Endurex Race Bike", + [tostring(GetHashKey("tribike3"))] = "Tri-Cycles Race Bike", + [tostring(GetHashKey("trophytruck"))] = "Trophy Truck", + [tostring(GetHashKey("trophytruck2"))] = "Desert Raid", + [tostring(GetHashKey("tropic"))] = "Tropic", + [tostring(GetHashKey("tropic2"))] = "Tropic", + [tostring(GetHashKey("tropos"))] = "Tropos Rallye", + [tostring(GetHashKey("tug"))] = "Tug", + [tostring(GetHashKey("turismor"))] = "Turismo R", + [tostring(GetHashKey("tvtrailer"))] = "Trailer", + [tostring(GetHashKey("tyrus"))] = "Tyrus", + [tostring(GetHashKey("utillitruck"))] = "Utility Truck", + [tostring(GetHashKey("utillitruck2"))] = "Utility Truck", + [tostring(GetHashKey("utillitruck3"))] = "Utility Truck", + [tostring(GetHashKey("vacca"))] = "Vacca", + [tostring(GetHashKey("vader"))] = "Vader", + [tostring(GetHashKey("valkyrie"))] = "Valkyrie", + [tostring(GetHashKey("valkyrie2"))] = "Valkyrie MOD.0", + [tostring(GetHashKey("velum"))] = "Velum", + [tostring(GetHashKey("velum2"))] = "Velum 5-Seater", + [tostring(GetHashKey("verlierer2"))] = "Verlierer", + [tostring(GetHashKey("vestra"))] = "Vestra", + [tostring(GetHashKey("vigero"))] = "Vigero", + [tostring(GetHashKey("vindicator"))] = "Vindicator", + [tostring(GetHashKey("virgo"))] = "Virgo", + [tostring(GetHashKey("virgo2"))] = "Virgo Classic Custom", + [tostring(GetHashKey("virgo3"))] = "Virgo Classic", + [tostring(GetHashKey("volatus"))] = "Volatus", + [tostring(GetHashKey("voltic"))] = "Voltic", + [tostring(GetHashKey("voodoo"))] = "Voodoo Custom", + [tostring(GetHashKey("voodoo2"))] = "Voodoo", + [tostring(GetHashKey("warrener"))] = "Warrener", + [tostring(GetHashKey("washington"))] = "Washington", + [tostring(GetHashKey("windsor"))] = "Windsor", + [tostring(GetHashKey("windsor2"))] = "Windsor Drop", + [tostring(GetHashKey("xls"))] = "XLS", + [tostring(GetHashKey("xls2"))] = "XLS (Armored)", + [tostring(GetHashKey("youga"))] = "Youga", + [tostring(GetHashKey("zentorno"))] = "Zentorno", + [tostring(GetHashKey("zion"))] = "Zion", + [tostring(GetHashKey("zion2"))] = "Zion Cabrio", + [tostring(GetHashKey("ztype"))] = "Z-Type" +} + +function reverseVehicleHash(hash) + if type(hash) ~= "string" then + hash = tostring(hash) + end + + local name = VEHICLE_HASHES[hash] + if name ~= nil then + return name + end + + Citizen.Trace("Error reversing vehicle hash \"" .. hash .. "\". Maybe it's not been added yet?") + return "Unknown Vehicle" +end diff --git a/client/reverse_weapon_hashes.lua b/client/reverse_weapon_hashes.lua index 97056ad..d4f61e6 100644 --- a/client/reverse_weapon_hashes.lua +++ b/client/reverse_weapon_hashes.lua @@ -85,6 +85,10 @@ local WEAPON_HASHES = { } function reverseWeaponHash(hash) + if type(hash) ~= "string" then + hash = tostring(hash) + end + local name = WEAPON_HASHES[hash] if name ~= nil then return name