Advertisement
Guest User

nl_miner - Config file

a guest
May 16th, 2022
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.17 KB | None | 0 0
  1.  
  2. --nl_miner - Osiris Studio
  3. --Have a nice day
  4.  
  5. --region config
  6. Config = {}
  7. ---@type Vehicle
  8. VehicleSpawnedTarget = nil
  9. VehicleTaken = 0
  10. ---@type table<Hash,table<string,number>>
  11. WorkClothes = {
  12.     [GetHashKey("mp_m_freemode_01")] = {
  13.         tshirt_1 = 15,
  14.         tshirt_2 = 0,
  15.         torso_1 = 16,
  16.         torso_2 = 0,
  17.         arms = 0,
  18.         pants_1 = 90,
  19.         pants_2 = 2,
  20.         shoes_1 = 12,
  21.         shoes_2 = 6,
  22.         bproof_1 = 0,
  23.         bproof_2 = 0,
  24.         mask_1 = 0,
  25.         mask_2 = 0,
  26.         bags_1 = 0,
  27.         bags_2 = 0 ,
  28.     },
  29.     [GetHashKey("mp_f_freemode_01")] = {
  30.         tshirt_1 = 15,
  31.         tshirt_2 = 0,
  32.         torso_1 = 0,
  33.         torso_2 = 0,
  34.         arms = 0,
  35.         pants_1 = 93,
  36.         pants_2 = 2,
  37.         shoes_1 = 59,
  38.         shoes_2 = 0,
  39.         bproof_1 = 0,
  40.         bproof_2 = 0,
  41.         mask_1 = 0,
  42.         mask_2 = 0,
  43.         bags_1 = 0,
  44.         bags_2 = 0 ,
  45.     },
  46. }
  47. Config.Keys = {
  48.     ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
  49.     ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
  50.     ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
  51.     ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
  52.     ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
  53.     ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
  54.     ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
  55.     ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
  56.     ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
  57. }
  58.  
  59.  
  60.  
  61.  
  62. Config.JobName = "miner" --ESX job to work with
  63. Config.Lockers = {
  64.     coords = vector3(1079.039,-1979.61,31.472),
  65. }
  66. Config.TakeVehicle = {
  67.     coords = vector3(1078.95,-1948.1,31.2),
  68.     heading = 107.0,
  69. }
  70. Config.RockModel = "prop_rock_4_e" --big rock model
  71. Config.SmallRockModel = "prop_rock_5_b" --small rock model
  72. Config.JobVehicle = GetHashKey("tiptruck") -- vehicle to work with
  73. Config.DeliverPoint = {
  74.     coords = vector3(1050.86,-1958.03, 31.04),
  75. }
  76. Config.RockSpawn = { --spawn of each rock, you can change if you need to and add as many as you want
  77.     vector3(2931.7290039062,2792.3244628906, 40.37),
  78.     vector3(2929.8776855468,2795.1745605468, 40.72),
  79.     vector3(2926.0349121094,2800.1857910156, 41.43),
  80.     vector3(2926.5351562500,2806.4189453125, 42.61),
  81.     vector3(2928.6613769532,2811.6469726562, 43.85),
  82.     vector3(2923.3645019532,2793.8374023438, 40.66),
  83.     vector3(2921.1418457032,2803.1501464844, 42.13),
  84.     vector3(2933.7819824218,2811.5668945312, 43.19),
  85. }
  86. Config.BlipsSettings = {
  87.     BaseBlip = {
  88.         name = "Miner - Ironworks",
  89.         coords = vector3(1077.897, -1979.24, 31.47),
  90.         sprite = 85,
  91.         display = 4,
  92.         scale = 0.8,
  93.         colour = 0,
  94.     },
  95.  
  96.     Quarry = {
  97.         name = "Miner - Quarry",
  98.         coords = vector3(2972.56, 2795.36, 40.00),
  99.         sprite = 85,
  100.         display = 4,
  101.         scale = 0.8,
  102.         colour = 0,
  103.     },
  104.  
  105.  
  106.     TakeVehicle = {
  107.         name = "Miner - Vehicle",
  108.         coords = vector3(Config.TakeVehicle.coords.x,Config.TakeVehicle.coords.y,Config.TakeVehicle.coords.z),
  109.         sprite = 67,
  110.         display = 4,
  111.         scale = 0.8,
  112.         colour = 0,
  113.     },
  114.  
  115.     Deliver = {
  116.         name = "Miner - Sell ores",
  117.         coords = vector3(Config.DeliverPoint.coords.x, Config.DeliverPoint.coords.y, Config.DeliverPoint.coords.z),
  118.         sprite = 434,
  119.         display = 4,
  120.         scale = 0.8,
  121.         colour = 0,
  122.     },
  123. }
  124.  
  125. Config.Markers = {
  126.     LockersMarker = {
  127.         type = 25,
  128.         size = 0.9,
  129.         rgba = {200,200,200,150},
  130.     },
  131.  
  132.     VehicleTakeMarker = {
  133.         type = 25,
  134.         size = 3.5,
  135.         rgba = {200,200,200,150},
  136.     },
  137.  
  138.     DeliverMarker = {
  139.         type = 25,
  140.         size = 1.3,
  141.         rgba = {200,200,200,150},
  142.     },
  143.  
  144.     OreMarker = {
  145.         type = 25,
  146.         size = 2.5,
  147.         rgba = {200,200,200,150},
  148.     },
  149.  
  150. }
  151.  
  152. Config.ButtonsLanguage = {
  153.     LockersButtonText = "~h~[E]~h~ To change clothes",
  154.     LockersButton = Config.Keys['E'],
  155.  
  156.     ReturnVehicleText = "~h~[H]~h~ Return vehicle",
  157.     ReturnVehicle = Config.Keys['H'],
  158.  
  159.     BorrowVehicleText = "~h~[E]~h~ Borrow vehicle",
  160.     BorrowVehicle= Config.Keys['E'],
  161.  
  162.     LockersText = "Lockers",
  163.     LockersJobWear = "Job clothes",
  164.     LockersNormalWear = "Your clothes",
  165.  
  166.     AlreadySpawnedCarText = "Your vehicle is already spawned",
  167.     WearYourUniformText = "Wear your uniform to continue",
  168.  
  169.     MineRockText = "~h~[E]~h~ Mine the ore",
  170.     MineRock = Config.Keys['E'],
  171.  
  172.     InstructionsToMineText = "Press ~h~LMB~h~ or ~h~Space~h~ to mine the ore",
  173.     BreakRockText = "Break the rock to small pieces",
  174.  
  175.     InCarOrDropText = "~h~[G]~h~ Put in vehicle / ~h~[H]~h~ Drop ore",
  176.     DropOreButton = Config.Keys['H'],
  177.     PutOreButton = Config.Keys['G'],
  178.  
  179.     NotWorkVehicleText = "This is not a work vehicle",
  180.  
  181.     RockInVehicle = "Put the rock in the vehicle",
  182.  
  183.     TakePreviousRock = "Collect ore from previously mined ore",
  184.     MoveCloserCarText = "Move closer to the car to take the ore",
  185.     JobVehicleFarAway = "Your job vehicle is too far away, it needs to be closer",
  186.  
  187.     YourVehicle = "Your vehicle",
  188.     TakeOreFromVehicle = "~h~[G]~h~ Take ore from your vehicle",
  189.     Deliver = "~h~[G]~h~ Deliver",
  190.     DeliverButton = Config.Keys['G'],
  191.     PutRockInCarButton = Config.Keys['G'],
  192.     SoldAllOres = "Sold ores for",
  193.     NoOres = "No ores to sell",
  194.  
  195. }
  196.  
  197. Config.orePrices = { --item name = price
  198.     copper = 100,
  199.     iron = 120,
  200.     gold = 150,
  201.     sapphire = 250,
  202.     diamond = 500,
  203. }
  204. --endregion
  205.  
  206.  
  207.  
  208. --region functions only
  209. function SpawnJobVehicle()
  210.     RequestModel(Config.JobVehicle)
  211.     while not HasModelLoaded(Config.JobVehicle) do
  212.     Citizen.Wait(0)
  213.     end
  214.  
  215.     ClearAreaOfVehicles(Config.TakeVehicle.coords.x, Config.TakeVehicle.coords.y, Config.TakeVehicle.coords.z, 15.0, false, false, false, false, false)
  216.     VehicleSpawnedTarget = CreateVehicle(Config.JobVehicle, Config.TakeVehicle.coords.x, Config.TakeVehicle.coords.y, Config.TakeVehicle.coords.z, Config.TakeVehicle.heading, true, true)
  217.     SetEntityHeading(VehicleSpawnedTarget, Config.TakeVehicle.heading)
  218.     TaskWarpPedIntoVehicle(PlayerPedId(), VehicleSpawnedTarget, - 1)
  219.     local plateRand = math.random(111,999)
  220.     SetVehicleNumberPlateText(VehicleSpawnedTarget, "MINER"..plateRand)
  221.     SetVehicleColours(VehicleSpawnedTarget, 1,1)
  222.     SetVehicleExtra(VehicleSpawnedTarget,2,true)
  223.     SetEntityAsMissionEntity(VehicleSpawnedTarget,true,true)
  224.     SetVehicleEngineOn(VehicleSpawnedTarget,true,true,false)
  225.     VehicleTaken = 1
  226. end
  227.  
  228. ---NormalNotification
  229. ---@param text string
  230. function NormalNotification(text) -- you can change to whatever notification you are using
  231.     SetNotificationTextEntry('STRING')
  232.     AddTextComponentSubstringPlayerName(text)
  233.     DrawNotification(false, true)
  234. end
  235.  
  236. ---hintToDisplay
  237. ---@param text string
  238. function hintToDisplay(text)
  239.     SetTextComponentFormat("STRING")
  240.     AddTextComponentString(text)
  241.     DisplayHelpTextFromStringLabel(0, false, true, -1)
  242. end
  243.  
  244.  
  245. ---DrawText3D
  246. ---@param x number
  247. ---@param y number
  248. ---@param z number
  249. ---@param text string
  250. function DrawText3D(x, y, z, text)
  251.     local onScreen,_x,_y=World3dToScreen2d(x, y, z)
  252.     if onScreen then
  253.         SetTextScale(0.35, 0.35)
  254.         SetTextFont(4)
  255.         SetTextProportional(true)
  256.         SetTextColour(255, 255, 255, 215)
  257.         SetTextEntry("STRING")
  258.         SetTextCentre(true)
  259.         SetTextOutline()
  260.         AddTextComponentString(text)
  261.         DrawText(_x,_y)
  262.         local factor = (string.len(text)) / 370
  263.         DrawRect(_x,_y+0.0125, 0.015+ factor, 0.03, 23, 23, 23, 90)
  264.     end
  265. end
  266. --endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement