Guest User

F_VehThief Config

a guest
Mar 24th, 2024
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.02 KB | Source Code | 0 0
  1. Config = {}
  2. Public = {}
  3.  
  4.  
  5. Config.Framework = "ESX" -- "ESX"/"QBCore"
  6. Config.Inventory = "ox" -- "ox"/"qb"
  7.  
  8. Config.FinderBlipActive = true
  9.  
  10. Config.InteractionType = "3dtext"-- "ox-target"/"3dtext"/"helpnotification"
  11.  
  12. Config.Debug = false
  13.  
  14. Config.MinCops = 1
  15. Config.CopJobs = {
  16.     'police',
  17.     'fbi'
  18. }
  19. Config.GPSTimer = 60 -- seconds (GPS will be stopped after Config.GPSTimer seconds)
  20. Config.GPSInterval = 10 -- seconds (How often the stolen vehicle's position is shown to cops)
  21. Config.GPSRadius = 120.0 -- The radius of the red circle
  22. Config.UseGPSOffset = true -- Randomize the center of the red circle
  23. Config.GPSBlip = {
  24.     id = 227,
  25.     color = 1,
  26.     scale = 1.0,
  27.     label = "Stolen Vehicle"
  28. }
  29.  
  30. -- Default hotwires work using ox_lib. Please download ox_lib or edit Public.HotwireProgress and Public.HotwireSkillcheck
  31. Config.HotwireType = "skillcheck" -- "progress"/"skillcheck"
  32. Config.Hotwire = {
  33.     ["progress"] = {
  34.         hotwire_time = 20, -- seconds
  35.     },
  36.     ["skillcheck"] = {
  37.         consecutive_skillchecks = 6,
  38.         difficulty = 'easy' -- 'easy'/'medium'/'hard'
  39.     }
  40. }
  41.  
  42. Config.ShowDeliveryBlipOnlyInStolenVehicle = true
  43. Config.DeliveryPos = {
  44.     {
  45.         pos = vector3(3333.6, 5160.34, 19.1),
  46.         showBlip = true,
  47.         blip = {
  48.             id = 303,
  49.             color = 1,
  50.             scale = 1.0,
  51.             label = "Stolen Vehicle Delivery"
  52.         }
  53.     },
  54.     {
  55.         pos = vector3(-57.0, -2659.6, 6.9),
  56.         showBlip = true,
  57.         blip = {
  58.             id = 303,
  59.             color = 1,
  60.             scale = 1.0,
  61.             label = "Stolen Vehicle Delivery"
  62.         }
  63.     }
  64. }
  65.  
  66.  
  67. Config.UseLockpick = true
  68. Config.LockpickItem = 'lockpick'
  69.  
  70. Config.UseDrill = true
  71. Config.DrillItem = 'drill'
  72. Config.DrillTime = 1 -- seconds
  73.  
  74. Config.PayAccountMoney = 'black_money'
  75. Config.EarnAccountMoney = 'black_money'
  76.  
  77. Config.GuardCombatAbility = 2 -- 0 / 1 / 2
  78.  
  79. Config.VehicleFinder = {
  80.     pos = vector4(1993.5, 3050.5, 46.27, 141.7),
  81.     blip = {
  82.         id = 671,
  83.         color = 1,
  84.         scale = 1.0,
  85.         label = "Finder"
  86.     },
  87.     npc = 'u_m_m_streetart_01',
  88.     anim = {
  89.         dict = 'amb@prop_human_seat_chair@female@arms_folded@idle_a',
  90.         name = 'idle_c'
  91.     }
  92. }
  93.  
  94. -- Make sure that these prices and the ones in possible_vehicles are the same!
  95. Config.VehiclePrices = {
  96.     ['cinquemila'] = 100000,
  97.     ['comet5'] = 70000,
  98.     ['sultanrs'] = 25000,
  99.     ['elegy'] = 30000,
  100.     ['italirsx'] = 150000,
  101.     ['zeno'] = 120000,
  102. }
  103.  
  104. Config.OneVehTheft = {
  105.     price = 20000,
  106.     possible_vehicles = {
  107.         ['elegy'] = 30000,
  108.         ['comet5'] = 70000,
  109.         --... You can add more random vehicles!
  110.     },
  111.     positions = {
  112.         {
  113.             pos = vector4(1381.9, 1118.6, 114.6, 45.35),
  114.             guards = {
  115.                 {
  116.                     npc = 'u_m_m_streetart_01',
  117.                     weapon = 'WEAPON_PISTOL',
  118.                     pos = vector4(1388.2, 1120.7, 114.6, 70.8),
  119.                 },
  120.                 {
  121.                     npc = 'u_m_m_streetart_01',
  122.                     weapon = 'WEAPON_PISTOL',
  123.                     pos = vector4(1370.6, 1122.9, 114.12, 294.8),
  124.                 },
  125.                 {
  126.                     npc = 'u_m_m_streetart_01',
  127.                     weapon = 'WEAPON_PISTOL',
  128.                     pos = vector4(1382.05, 1129.7, 114.3, 113.4),
  129.                 },
  130.             },
  131.         },
  132.         {
  133.             pos = vector4(-221.9, -1330.6, 30.9, 286.3),
  134.             guards = {
  135.                 {
  136.                     npc = 'u_m_m_streetart_01',
  137.                     weapon = 'WEAPON_PISTOL',
  138.                     pos = vector4(-220.8, -1326.3, 30.9, 238.1),
  139.                 },
  140.  
  141.                 {
  142.                     npc = 'u_m_m_streetart_01',
  143.                     weapon = 'WEAPON_PISTOL',
  144.                     pos = vector4(-214.3, -1317.7, 30.9, 206.92),
  145.                 },
  146.  
  147.                 {
  148.                     npc = 'u_m_m_streetart_01',
  149.                     weapon = 'WEAPON_PISTOL',
  150.                     pos = vector4(-212.4, -1334.3, 34.9, 31.18),
  151.                 }
  152.             }
  153.         }
  154.     },
  155.    
  156. }
  157.  
  158. Config.TwoVehTheft = {
  159.     trailer_blip = {
  160.         id = 67,
  161.         color = 1,
  162.         scale = 1.0,
  163.         label = "Trailer"
  164.     },
  165.     drivingStyle = 524735, --https://vespura.com/fivem/drivingstyle/
  166.     drivingSpeed = 20.0,
  167.     price = 60000,
  168.     possible_vehicles = {
  169.         ['cinquemila'] = 100000,
  170.         ['italirsx'] = 150000,
  171.         ['zeno'] = 120000,
  172.         --... You can add more random vehicles!
  173.     },
  174.     positions = {
  175.         {
  176.             pos = vector4(-499.05, -2823.6, 5.99, 314.6),
  177.             guards = {
  178.                 {
  179.                     car = 'dubsta',
  180.                     pos = vector4(-520.9, -2826.7, 5.99, 289.1),
  181.                     npcs = {
  182.                         {
  183.                             npc = 'u_m_m_streetart_01',
  184.                             weapon = 'WEAPON_PISTOL',
  185.                             seat = -1 -- -1 is driver
  186.                         },
  187.                         {
  188.                             npc = 'u_m_m_streetart_01',
  189.                             weapon = 'WEAPON_PISTOL',
  190.                             seat = 0 -- -1 is driver
  191.                         },
  192.                         {
  193.                             npc = 'u_m_m_streetart_01',
  194.                             weapon = 'WEAPON_PISTOL',
  195.                             seat = 1 -- -1 is driver
  196.                         },
  197.                     }
  198.                 },
  199.  
  200.                 {
  201.                     car = 'dominator',
  202.                     pos = vector4(-513.96, -2851.9, 5.99, 238.81),
  203.                     npcs = {
  204.                         {
  205.                             npc = 'u_m_m_streetart_01',
  206.                             weapon = 'WEAPON_PISTOL',
  207.                             seat = -1 -- -1 is driver
  208.                         }
  209.                     }
  210.                 },
  211.             },
  212.         },
  213.        
  214.     },
  215.    
  216. }
  217.  
  218. Config.BuyGarageMoneyAccount = 'black_money'
  219.  
  220. --[[
  221.     994.5925, -3002.594, -39.64699
  222.     -1350.0, 160.0, -100.0
  223.     800.13696, -3001.4297, -65.14074
  224. ]]
  225. Config.Garages = {
  226.     {
  227.         name = "garage_1",
  228.         price = 30000,
  229.         inside = vector4(797.592, -3012.012, -70.000, 5.38),
  230.         outside = vector4(474.9, -1325.16, 28.5, 294.8),
  231.         veh_take_out = vector4(478.56, -1333.13, 29.17, 255.11),
  232.         positions = {
  233.             vector4(800.141, -2996.755, -69.000, 90.0),
  234.             vector4(800.268, -3002.740, -69.000, 90.0),
  235.             vector4(800.296, -3008.445, -69.000, 90.0),
  236.         },
  237.         blip = {
  238.             show = 'everyone', -- 'everyone'/'owner'/'noone'
  239.             id = 357,
  240.             color = 1,
  241.             scale = 1.0,
  242.             label = "Hidden Garage"
  243.         }
  244.     }
  245. }
  246.  
  247. Config.VehicleDamages = {
  248.     ['door_broken'] = 15,
  249.     ['tire_broken'] = 15,
  250.     ['light_broken'] = 15
  251. }
  252.  
  253. Config.RepairPrice = 100 -- $ every 1% lost in vehicle's condition
  254.  
  255. Public.ClientNotification = function(msg, type)
  256.     FW.ClientNotify(msg)
  257. end
  258.  
  259. Public.ServerNotification = function(source, msg, type)
  260.     FW.ServerNotify(source, msg, type)
  261. end
  262.  
  263. Public.AlertCops = function(vehicle, coords)
  264.  
  265.     -- If you have a custom dispatch system, edit this function!
  266.     TriggerServerEvent('F_VehThief:AlertCops', NetworkGetNetworkIdFromEntity(vehicle), GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))) -- Sends a notification to the jobs in Config.CopJobs
  267.     TriggerServerEvent('F_VehThief:SendGPSToCops', NetworkGetNetworkIdFromEntity(vehicle)) -- Sends the stolen vehicle location to the jobs in Config.CopJobs
  268. end
  269.  
  270. Public.HotwireProgress = function(cb)
  271.     if exports.ox_lib:progressCircle({
  272.         duration = Config.Hotwire['progress'].hotwire_time * 1000,
  273.         position = 'bottom',
  274.         useWhileDead = false,
  275.         canCancel = false,
  276.         disable = {
  277.             car = true,
  278.             move = true,
  279.             combat = true
  280.         },
  281.         anim = {
  282.             dict = 'anim@veh@plane@howard@front@ds@base',
  283.             clip = 'hotwire'
  284.         },
  285.     }) then cb() end
  286. end
  287.  
  288. Public.Drill = function(cb)
  289.     if exports.ox_lib:progressCircle({
  290.         duration = Config.DrillTime * 1000,
  291.         position = 'bottom',
  292.         useWhileDead = false,
  293.         canCancel = false,
  294.         disable = {
  295.             car = true,
  296.             move = true,
  297.             combat = true
  298.         },
  299.         anim = {
  300.             dict = 'anim@heists@fleeca_bank@drilling',
  301.             clip = 'drill_left_fail'
  302.         },
  303.     }) then cb() end
  304. end
  305.  
  306. Public.HotwireSkillcheck = function(cb)
  307.  
  308.     local success = nil
  309.  
  310.     while not HasAnimDictLoaded('anim@veh@plane@howard@front@ds@base') do
  311.         RequestAnimDict('anim@veh@plane@howard@front@ds@base')
  312.         Wait(100)
  313.     end
  314.     TaskPlayAnim(PlayerPedId(), 'anim@veh@plane@howard@front@ds@base', 'hotwire', 8.0, 8.0, -1, 31, 1.0, 0, 0, 0)
  315.  
  316.     while not success do
  317.  
  318.         local skillchecks = {}
  319.         for i=1,3 do
  320.             table.insert(skillchecks, Config.Hotwire['skillcheck'].difficulty)
  321.         end
  322.        
  323.         success = exports.ox_lib:skillCheck(skillchecks, {'w', 'a', 's', 'd'})
  324.  
  325.         if success then
  326.             exports.ox_lib:cancelSkillCheck()
  327.             StopEntityAnim(PlayerPedId(), 'hotwire', 'anim@veh@plane@howard@front@ds@base', 1.0)
  328.             cb()
  329.         end
  330.  
  331.         Wait(0)
  332.     end
  333. end
  334.  
  335. Config.Labels = {
  336.     ['press_to_talk'] = 'Press [E] to talk',
  337.     ['press_to_talk_helpnotification'] = 'Press ~INPUT_CONTEXT~ to talk',
  338.     ['talk'] = "Talk",
  339.     ['not_enough_cops'] = "There are not enough cops",
  340.     ['finder_text'] = "What are you looking for?",
  341.     ['vehicles'] = 'Vehicles:',
  342.     ['gps'] = 'GPS:',
  343.     ['guards'] = 'Guards:',
  344.     ['reward'] = 'Reward:',
  345.     ['price'] = 'Price:',
  346.     ['info'] = "Info",
  347.     ['cancel'] = "CANCEL",
  348.     ['confirm'] = "CONFIRM",
  349.     ['info-1'] = "I will send you the location of the vehicle, but be careful: there may be guards. Open the vehicle using a lockpick and run as fast as you can! A GPS may be present in your vehicle and police will be able to see your position! If you have a garage, you can take the vehicle here to remove the GPS.",
  350.     ['info-2'] = "I will send you the location of the truck, but be careful: there may be guards. Drill the truck's ramp and then open the vehicles using lockpicks! A GPS may be present in your vehicle and police will be able to see your position! If you have a garage, you can take the vehicle here to remove the GPS.",
  351.     ['not_enough_money'] = "You do not have enough money!",
  352.     ['job_start'] = "You accepted the job! Check your map.",
  353.     ['break_window_target'] = "Break Window",
  354.     ['use_lockpick_kit_target'] = "Use Lockpick Kit",
  355.     ['break_window_3dtext'] = "[E] Break Window",
  356.     ['use_lockpick_kit_3dtext'] = "[G] Use Lockpick Kit",
  357.     ['break_window_helpnotification'] = "~INPUT_CONTEXT~ Break Window",
  358.     ['use_lockpick_kit_helpnotification'] ="~INPUT_DETONATE~ Use Lockpick Kit",
  359.     ['cops_notification'] = "A %s was stolen! Check your GPS!",
  360.     ['open_garage_3dtext'] = "[E] Garage",
  361.     ['open_garage_helpnotification'] = "~INPUT_CONTEXT~ Garage",
  362.     ['open_garage_target'] = "Garage",
  363.     ['exit_garage_3dtext'] = "[E] Exit Garage",
  364.     ['exit_garage_helpnotification'] = "~INPUT_CONTEXT~ Exit Garage",
  365.     ['exit_garage_target'] = "Exit Garage",
  366.     ['veh_not_stolen'] = "This is not a stolen vehicle!",
  367.     ['garage_full'] = "Your garage is full!",
  368.     ['price_2'] = "Price",
  369.     ['slots'] = "Slots",
  370.     ['buy_this_garage'] = "Would you like to buy this garage?",
  371.     ['garage_bought'] = "You bought this garage!",
  372.     ['garage_veh_data'] = "Name: %s\nCondition: %s\n[E] Take Out\n[G] Repair (%s$)",
  373.     ['sell_vehicle'] = "Sell Vehicle",
  374.     ['sell_this_vehicle'] = "Would you like to sell this vehicle?",
  375.     ['you_earned'] = "You earned %s$",
  376.     ['sell_3dtext'] = "[E] Sell Vehicle",
  377.     ['sell_helpnotification'] = "~INPUT_CONTEXT~ Sell Vehicle",
  378.     ['drill_target'] = "Drill",
  379.     ['drill_3dtext'] = "[E] Drill",
  380.     ['drill_helpnotification'] = "~INPUT_CONTEXT~ Drill",
  381.     ['no_drill'] = "You do not have a drill!"
  382. }
  383.  
  384. while not Utils do
  385.     Wait(10)
  386. end
  387. --  UI STUFF, DO NOT TOUCH!
  388. Config.OneVehTheft.minGuards = Utils.GetMinGuards(Config.OneVehTheft.positions)
  389. Config.OneVehTheft.maxGuards = Utils.GetMaxGuards(Config.OneVehTheft.positions)
  390. Config.OneVehTheft.minReward = tostring(math.floor(Utils.GetMinReward(Config.OneVehTheft.possible_vehicles)/1000))..'k'
  391. Config.OneVehTheft.maxReward = tostring(math.floor(Utils.GetMaxReward(Config.OneVehTheft.possible_vehicles)/1000))..'k'
  392.  
  393. Config.TwoVehTheft.minGuards = Utils.GetMinGuards2(Config.TwoVehTheft.positions)
  394. Config.TwoVehTheft.maxGuards = Utils.GetMaxGuards2(Config.TwoVehTheft.positions)
  395. Config.TwoVehTheft.minReward = tostring(math.floor(Utils.GetMinReward(Config.TwoVehTheft.possible_vehicles)/1000))..'k'
  396. Config.TwoVehTheft.maxReward = tostring(math.floor(Utils.GetMaxReward(Config.TwoVehTheft.possible_vehicles)/1000))..'k'
  397.  
Tags: lua
Add Comment
Please, Sign In to add comment