Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --nl_miner - Osiris Studio
- --Have a nice day
- --region config
- Config = {}
- ---@type Vehicle
- VehicleSpawnedTarget = nil
- VehicleTaken = 0
- ---@type table<Hash,table<string,number>>
- WorkClothes = {
- [GetHashKey("mp_m_freemode_01")] = {
- tshirt_1 = 15,
- tshirt_2 = 0,
- torso_1 = 16,
- torso_2 = 0,
- arms = 0,
- pants_1 = 90,
- pants_2 = 2,
- shoes_1 = 12,
- shoes_2 = 6,
- bproof_1 = 0,
- bproof_2 = 0,
- mask_1 = 0,
- mask_2 = 0,
- bags_1 = 0,
- bags_2 = 0 ,
- },
- [GetHashKey("mp_f_freemode_01")] = {
- tshirt_1 = 15,
- tshirt_2 = 0,
- torso_1 = 0,
- torso_2 = 0,
- arms = 0,
- pants_1 = 93,
- pants_2 = 2,
- shoes_1 = 59,
- shoes_2 = 0,
- bproof_1 = 0,
- bproof_2 = 0,
- mask_1 = 0,
- mask_2 = 0,
- bags_1 = 0,
- bags_2 = 0 ,
- },
- }
- Config.Keys = {
- ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
- ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
- ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
- ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
- ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
- ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
- ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
- ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
- ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
- }
- Config.JobName = "miner" --ESX job to work with
- Config.Lockers = {
- coords = vector3(1079.039,-1979.61,31.472),
- }
- Config.TakeVehicle = {
- coords = vector3(1078.95,-1948.1,31.2),
- heading = 107.0,
- }
- Config.RockModel = "prop_rock_4_e" --big rock model
- Config.SmallRockModel = "prop_rock_5_b" --small rock model
- Config.JobVehicle = GetHashKey("tiptruck") -- vehicle to work with
- Config.DeliverPoint = {
- coords = vector3(1050.86,-1958.03, 31.04),
- }
- Config.RockSpawn = { --spawn of each rock, you can change if you need to and add as many as you want
- vector3(2931.7290039062,2792.3244628906, 40.37),
- vector3(2929.8776855468,2795.1745605468, 40.72),
- vector3(2926.0349121094,2800.1857910156, 41.43),
- vector3(2926.5351562500,2806.4189453125, 42.61),
- vector3(2928.6613769532,2811.6469726562, 43.85),
- vector3(2923.3645019532,2793.8374023438, 40.66),
- vector3(2921.1418457032,2803.1501464844, 42.13),
- vector3(2933.7819824218,2811.5668945312, 43.19),
- }
- Config.BlipsSettings = {
- BaseBlip = {
- name = "Miner - Ironworks",
- coords = vector3(1077.897, -1979.24, 31.47),
- sprite = 85,
- display = 4,
- scale = 0.8,
- colour = 0,
- },
- Quarry = {
- name = "Miner - Quarry",
- coords = vector3(2972.56, 2795.36, 40.00),
- sprite = 85,
- display = 4,
- scale = 0.8,
- colour = 0,
- },
- TakeVehicle = {
- name = "Miner - Vehicle",
- coords = vector3(Config.TakeVehicle.coords.x,Config.TakeVehicle.coords.y,Config.TakeVehicle.coords.z),
- sprite = 67,
- display = 4,
- scale = 0.8,
- colour = 0,
- },
- Deliver = {
- name = "Miner - Sell ores",
- coords = vector3(Config.DeliverPoint.coords.x, Config.DeliverPoint.coords.y, Config.DeliverPoint.coords.z),
- sprite = 434,
- display = 4,
- scale = 0.8,
- colour = 0,
- },
- }
- Config.Markers = {
- LockersMarker = {
- type = 25,
- size = 0.9,
- rgba = {200,200,200,150},
- },
- VehicleTakeMarker = {
- type = 25,
- size = 3.5,
- rgba = {200,200,200,150},
- },
- DeliverMarker = {
- type = 25,
- size = 1.3,
- rgba = {200,200,200,150},
- },
- OreMarker = {
- type = 25,
- size = 2.5,
- rgba = {200,200,200,150},
- },
- }
- Config.ButtonsLanguage = {
- LockersButtonText = "~h~[E]~h~ To change clothes",
- LockersButton = Config.Keys['E'],
- ReturnVehicleText = "~h~[H]~h~ Return vehicle",
- ReturnVehicle = Config.Keys['H'],
- BorrowVehicleText = "~h~[E]~h~ Borrow vehicle",
- BorrowVehicle= Config.Keys['E'],
- LockersText = "Lockers",
- LockersJobWear = "Job clothes",
- LockersNormalWear = "Your clothes",
- AlreadySpawnedCarText = "Your vehicle is already spawned",
- WearYourUniformText = "Wear your uniform to continue",
- MineRockText = "~h~[E]~h~ Mine the ore",
- MineRock = Config.Keys['E'],
- InstructionsToMineText = "Press ~h~LMB~h~ or ~h~Space~h~ to mine the ore",
- BreakRockText = "Break the rock to small pieces",
- InCarOrDropText = "~h~[G]~h~ Put in vehicle / ~h~[H]~h~ Drop ore",
- DropOreButton = Config.Keys['H'],
- PutOreButton = Config.Keys['G'],
- NotWorkVehicleText = "This is not a work vehicle",
- RockInVehicle = "Put the rock in the vehicle",
- TakePreviousRock = "Collect ore from previously mined ore",
- MoveCloserCarText = "Move closer to the car to take the ore",
- JobVehicleFarAway = "Your job vehicle is too far away, it needs to be closer",
- YourVehicle = "Your vehicle",
- TakeOreFromVehicle = "~h~[G]~h~ Take ore from your vehicle",
- Deliver = "~h~[G]~h~ Deliver",
- DeliverButton = Config.Keys['G'],
- PutRockInCarButton = Config.Keys['G'],
- SoldAllOres = "Sold ores for",
- NoOres = "No ores to sell",
- }
- Config.orePrices = { --item name = price
- copper = 100,
- iron = 120,
- gold = 150,
- sapphire = 250,
- diamond = 500,
- }
- --endregion
- --region functions only
- function SpawnJobVehicle()
- RequestModel(Config.JobVehicle)
- while not HasModelLoaded(Config.JobVehicle) do
- Citizen.Wait(0)
- end
- ClearAreaOfVehicles(Config.TakeVehicle.coords.x, Config.TakeVehicle.coords.y, Config.TakeVehicle.coords.z, 15.0, false, false, false, false, false)
- VehicleSpawnedTarget = CreateVehicle(Config.JobVehicle, Config.TakeVehicle.coords.x, Config.TakeVehicle.coords.y, Config.TakeVehicle.coords.z, Config.TakeVehicle.heading, true, true)
- SetEntityHeading(VehicleSpawnedTarget, Config.TakeVehicle.heading)
- TaskWarpPedIntoVehicle(PlayerPedId(), VehicleSpawnedTarget, - 1)
- local plateRand = math.random(111,999)
- SetVehicleNumberPlateText(VehicleSpawnedTarget, "MINER"..plateRand)
- SetVehicleColours(VehicleSpawnedTarget, 1,1)
- SetVehicleExtra(VehicleSpawnedTarget,2,true)
- SetEntityAsMissionEntity(VehicleSpawnedTarget,true,true)
- SetVehicleEngineOn(VehicleSpawnedTarget,true,true,false)
- VehicleTaken = 1
- end
- ---NormalNotification
- ---@param text string
- function NormalNotification(text) -- you can change to whatever notification you are using
- SetNotificationTextEntry('STRING')
- AddTextComponentSubstringPlayerName(text)
- DrawNotification(false, true)
- end
- ---hintToDisplay
- ---@param text string
- function hintToDisplay(text)
- SetTextComponentFormat("STRING")
- AddTextComponentString(text)
- DisplayHelpTextFromStringLabel(0, false, true, -1)
- end
- ---DrawText3D
- ---@param x number
- ---@param y number
- ---@param z number
- ---@param text string
- function DrawText3D(x, y, z, text)
- local onScreen,_x,_y=World3dToScreen2d(x, y, z)
- if onScreen then
- SetTextScale(0.35, 0.35)
- SetTextFont(4)
- SetTextProportional(true)
- SetTextColour(255, 255, 255, 215)
- SetTextEntry("STRING")
- SetTextCentre(true)
- SetTextOutline()
- AddTextComponentString(text)
- DrawText(_x,_y)
- local factor = (string.len(text)) / 370
- DrawRect(_x,_y+0.0125, 0.015+ factor, 0.03, 23, 23, 23, 90)
- end
- end
- --endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement