Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Esx mining edits #8

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 13 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
This work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0
International License][cc-by-nc-sa].

[![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]

[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
[cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png
[cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg

# tr-mining
Mining Script for QBCore
# ESX-Mining
Mining Script for ESX

## Whats included
- Easy to use config
Expand All @@ -19,80 +10,29 @@ Mining Script for QBCore
- DrawtextUi & Target Combined

## Dependencies
- [qb-core](https://github.com/qbcore-framework/qb-core) **Lastest Core with DrawtextUI**
- [qb-target](https://github.com/BerkieBb/qb-target)
- [qb-menu](https://github.com/qbcore-framework/qb-menu)
- [Esx-Legacy](https://github.com/esx-framework/esx-legacy)
- [Qtarget](https://github.com/overextended/qtarget)
- [PolyZone](https://github.com/mkafrin/PolyZone)
- [nw-mine](https://github.com/Nowimps8/nw_mine)

## Installation

Add the item to your **qb-core/shared/item.lua**
```
-- Mining
['mining_pickaxe'] = {['name'] = 'mining_pickaxe', ['label'] = 'Mining Pickaxe', ['weight'] = 500, ['type'] = 'item', ['image'] = 'mining_pickaxe.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Classic\'s pickaxe for mining'},
['mining_pan'] = {['name'] = 'mining_pan', ['label'] = 'Washing Pan', ['weight'] = 500, ['type'] = 'item', ['image'] = 'mining_pan.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Classic\'s washing pan'},
['mining_stone'] = {['name'] = 'mining_stone', ['label'] = 'Mined Stone', ['weight'] = 500, ['type'] = 'item', ['image'] = 'mining_stone.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Mined Stone'},
['mining_washedstone'] = {['name'] = 'mining_washedstone', ['label'] = 'Washed Stone', ['weight'] = 500, ['type'] = 'item', ['image'] = 'mining_washedstone.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Wasted Stone'},
['mining_ironfragment'] = {['name'] = 'mining_ironfragment', ['label'] = 'Iron Fragment', ['weight'] = 500, ['type'] = 'item', ['image'] = 'mining_ironfragment.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Iron fragment from mining'},
['mining_ironbar'] = {['name'] = 'mining_ironbar', ['label'] = 'Iron Bar', ['weight'] = 500, ['type'] = 'item', ['image'] = 'mining_ironbar.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Iron Bar'},
['mining_goldnugget'] = {['name'] = 'mining_goldnugget', ['label'] = 'Golden Nugget', ['weight'] = 500, ['type'] = 'item', ['image'] = 'mining_goldnugget.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Golden nugget from mining'},
['mining_goldbar'] = {['name'] = 'mining_goldbar', ['label'] = 'Gold Bar', ['weight'] = 500, ['type'] = 'item', ['image'] = 'mining_goldbar.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Gold Bar'},
['mining_copperfragment'] = {['name'] = 'mining_copperfragment', ['label'] = 'Copper Fragment', ['weight'] = 500, ['type'] = 'item', ['image'] = 'mining_copperfragment.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Copper fragment from mining'},
['mining_copperbar'] = {['name'] = 'mining_copperbar', ['label'] = 'Copper Bar', ['weight'] = 500, ['type'] = 'item', ['image'] = 'mining_copperbar.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Copper Bar'},

```
For images move the images from the img folder to your inventory image folder **qb-inventory/html/images**

If you use another Drawtext like cd_drawtextui for example change the following in the **client/main.lua 287 - 296**

**Before** DRAWTEXT
```
exports['qb-core']:DrawText(Config.Text['MiningAlert'], 'left')

exports['qb-core']:DrawText(Config.Text['StartMining'],'left')
```

**After**
```
TriggerEvent('cd_drawtextui:ShowUI', 'show', Config.Text['MiningAlert'])

TriggerEvent('cd_drawtextui:ShowUI', 'show', Config.Text['StartMining'])
```

**Before** HIDETEXT
```
exports['qb-core']:HideText()
```

**After**
```
TriggerEvent('cd_drawtextui:HideUI')
```

**You will also need to remove this line if you are using CD_Drawtextui**
**Line 160**
```
exports['qb-core']:KeyPressed()
```

## **Drawtext Ui Files will be provided if you don't have it installed in your core**
- [QBCore_Drawtext](https://github.com/trclassic92/QBCore_Drawtext) **Only add if you dont have the lastest core update**

Download the resource, rename it from esx-mining-main to esx-mining, drag it into your resource folder. ensure it in your server.cfg, dont forget to run the items.sql into the database

## Preview Pictures
- [Youtube Video](https://youtu.be/9VXjTrUdjfc)
![Preview Screenshot](https://i.imgur.com/jIJ9SOU.png)
![Preview Screenshot](https://i.imgur.com/mu0gNQC.jpeg)
![Preview Screenshot](https://i.imgur.com/7gKe9wE.jpeg)
![Preview Screenshot](https://i.imgur.com/cGaTg3V.jpeg)
![Preview Screenshot](https://i.imgur.com/my22yZL.jpeg)
![image](https://user-images.githubusercontent.com/102178921/165142626-75b1e6ba-4c4b-415f-b4f5-edb3a678064d.png))
![image](https://user-images.githubusercontent.com/102178921/165142476-1c5ea064-c3e0-4744-9f25-4868717a72e1.png))
![Preview Screenshot](https://i.imgur.com/fUQ61Bl.jpeg)
![Preview Screenshot](https://i.imgur.com/S382wMf.jpeg)
![Preview Screenshot](https://i.imgur.com/VJCk6cx.jpeg)

## Discord
- [Join Discord](https://discord.gg/zRCdhENsHG)
- [ESX](https://discord.com/invite/VKX6DHVyhV)
- [Join Classics Discord](https://discord.gg/zRCdhENsHG)

## Support The Script
- [Ko-fi Link](https://ko-fi.com/trclassic)
- [Ko-fi Link for Classic](https://ko-fi.com/trclassic)

## Credits
[Classic](https://github.com/trclassic92)
51 changes: 11 additions & 40 deletions client/blips.lua
Original file line number Diff line number Diff line change
@@ -1,45 +1,16 @@
local QBCore = exports['qb-core']:GetCoreObject()

if Config.UseBlips then
CreateThread(function()
MineShaftBlip = AddBlipForCoord(MiningLocation.coords)
SetBlipSprite (MineShaftBlip, MiningLocation.SetBlipSprite)
SetBlipDisplay(MineShaftBlip, MiningLocation.SetBlipDisplay)
SetBlipScale (MineShaftBlip, MiningLocation.SetBlipScale)
SetBlipAsShortRange(MineShaftBlip, true)
SetBlipColour(MineShaftBlip, MiningLocation.SetBlipColour)
for k,v in pairs(Config.Blips) do
local Blip = AddBlipForCoord(v.coords)
SetBlipSprite (Blip, v.Sprite)
SetBlipDisplay(Blip, v.Display)
SetBlipScale (Blip, v.Scale)
SetBlipAsShortRange(Blip, true)
SetBlipColour(Blip, v.Colour)
BeginTextCommandSetBlipName("STRING")
AddTextComponentSubstringPlayerName(MiningLocation.BlipLabel)
EndTextCommandSetBlipName(MineShaftBlip)

WashBlip = AddBlipForCoord(WashLocation.coords)
SetBlipSprite (WashBlip, WashLocation.SetBlipSprite)
SetBlipDisplay(WashBlip, WashLocation.SetBlipDisplay)
SetBlipScale (WashBlip, WashLocation.SetBlipScale)
SetBlipAsShortRange(WashBlip, true)
SetBlipColour(WashBlip, WashLocation.SetBlipColour)
BeginTextCommandSetBlipName("STRING")
AddTextComponentSubstringPlayerName(WashLocation.BlipLabel)
EndTextCommandSetBlipName(WashBlip)

SmeltBlip = AddBlipForCoord(SmeltLocation.coords)
SetBlipSprite (SmeltBlip, SmeltLocation.SetBlipSprite)
SetBlipDisplay(SmeltBlip, SmeltLocation.SetBlipDisplay)
SetBlipScale (SmeltBlip, SmeltLocation.SetBlipScale)
SetBlipAsShortRange(SmeltBlip, true)
SetBlipColour(SmeltBlip, SmeltLocation.SetBlipColour)
BeginTextCommandSetBlipName("STRING")
AddTextComponentSubstringPlayerName(SmeltLocation.BlipLabel)
EndTextCommandSetBlipName(SmeltBlip)

SellerBlip = AddBlipForCoord(SellLocation.coords)
SetBlipSprite (SellerBlip, SellLocation.SetBlipSprite)
SetBlipDisplay(SellerBlip, SellLocation.SetBlipDisplay)
SetBlipScale (SellerBlip, SellLocation.SetBlipScale)
SetBlipAsShortRange(SellerBlip, true)
SetBlipColour(SellerBlip, SellLocation.SetBlipColour)
BeginTextCommandSetBlipName("STRING")
AddTextComponentSubstringPlayerName(SellLocation.BlipLabel)
EndTextCommandSetBlipName(SellerBlip)
AddTextComponentSubstringPlayerName(v.Label)
EndTextCommandSetBlipName(Blip)
Config.Blips[k].blip = Blip
end
end)
end
Loading