├── .github ├── FUNDING.yml ├── workflows │ └── lint.yml └── ISSUE_TEMPLATE │ └── bug_report.md ├── fxmanifest.lua ├── ReadMe.md ├── client.lua └── Config.lua /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | 2 | ko_fi: trclassic 3 | -------------------------------------------------------------------------------- /fxmanifest.lua: -------------------------------------------------------------------------------- 1 | -- Support Discord 2 | -- https://discord.gg/zRCdhENsHG 3 | 4 | fx_version 'cerulean' 5 | game 'gta5' 6 | 7 | author 'TRClassic#0001' 8 | description 'Simple BlackMarket Script For QBCore' 9 | version '1.0.0' 10 | 11 | client_scripts { 12 | 'client.lua' 13 | } 14 | 15 | shared_scripts {'Config.lua'} 16 | 17 | dependencies { 18 | 'qb-menu', 19 | 'qb-target' 20 | } 21 | 22 | -- Support Discord 23 | -- https://discord.gg/zRCdhENsHG -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | on: [push, pull_request] 3 | jobs: 4 | lint: 5 | name: Lint Resource 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v2 9 | - name: Lint 10 | uses: iLLeniumStudios/fivem-lua-lint-action@v2 11 | with: 12 | capture: "junit.xml" 13 | args: "-t --formatter JUnit" 14 | extra_libs: polyzone 15 | - name: Generate Lint Report 16 | if: always() 17 | uses: mikepenz/action-junit-report@v3 18 | with: 19 | report_paths: "**/junit.xml" 20 | check_name: Linting Report 21 | fail_on_failure: false 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. 16 | 2. 17 | 3. 18 | 19 | **Expected behavior** 20 | A clear and concise description of what you expected to happen. 21 | 22 | **Screenshots** 23 | If applicable, add screenshots to help explain your problem. 24 | 25 | **Desktop (please complete the following information):** 26 | - QBCore Version (Old/New) 27 | - Have you tried fixing the problem on your own? 28 | 29 | **Additional context** 30 | Add any other context about the problem here. 31 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | This work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 2 | International License][cc-by-nc-sa]. 3 | 4 | [![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa] 5 | 6 | [cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/ 7 | [cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png 8 | [cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg 9 | 10 | # tr-blackmarket 11 | Black Market Script For QBCore 12 | 13 | # Features 14 | - Enable/Disable Blip Location 15 | - Easy To Configure 16 | - Discord Support (Discord can be found at the bottom of the readme) 17 | - Open Source 18 | - Organized Shop 19 | 20 | # Dependencies 21 | - [qb-core](https://github.com/qbcore-framework/qb-core) 22 | - [qb-target](https://github.com/qbcore-framework/qb-target) 23 | - [qb-menu](https://github.com/qbcore-framework/qb-menu) 24 | 25 | # Previews 26 | Youtube Preview: https://youtu.be/JCQB6jRRUmk 27 | 28 | ![Preview Screenshot](https://i.imgur.com/0BJHHMi.jpeg) 29 | ![Preview Screenshot](https://i.imgur.com/buYQbVM.jpeg) 30 | ![Preview Screenshot](https://i.imgur.com/kpa0jjG.jpeg) 31 | ![Preview Screenshot](https://i.imgur.com/3SOpmc8.jpeg) 32 | ![Preview Screenshot](https://i.imgur.com/VdqppwB.jpeg) 33 | ![Preview Screenshot](https://i.imgur.com/AkzdFql.jpeg) 34 | ![Preview Screenshot](https://i.imgur.com/tugVZWZ.jpeg) 35 | 36 | 37 | # Install 38 | 39 | 1. Download the resource from github (TRClassic92) 40 | 41 | 2. Add to your server files 42 | 43 | 3. ensure tr-blackmarket 44 | 45 | 4. Have fun :) 46 | 47 | ## Tebex 48 | - [Tebex](https://trclassic.tebex.io/) 49 | 50 | ## Discord 51 | - [Join Discord](https://discord.gg/T2xX5WwmEX) 52 | 53 | ## Support 54 | - [Ko-fi Link](https://ko-fi.com/trclassic) 55 | -------------------------------------------------------------------------------- /client.lua: -------------------------------------------------------------------------------- 1 | local TRClassicBlackMarketPed 2 | local itemCheck = Config.ItemCheck 3 | 4 | -- Remove ped model on resource stop. 5 | 6 | local function RemoveTRPed() 7 | if DoesEntityExist(TRClassicBlackMarketPed) then 8 | DeletePed(TRClassicBlackMarketPed) 9 | end 10 | end 11 | 12 | AddEventHandler('onResourceStop', function(resourceName) 13 | if GetCurrentResourceName() == resourceName then 14 | RemoveTRPed() 15 | end 16 | end) 17 | 18 | -- Target and ped model 19 | 20 | CreateThread(function() 21 | if Config.UseBlip then 22 | local BlackMarketBlip = AddBlipForCoord(Config.Location.Coords) 23 | SetBlipSprite(BlackMarketBlip, Config.Location.SetBlipSprite) 24 | SetBlipDisplay(BlackMarketBlip, Config.Location.SetBlipDisplay) 25 | SetBlipScale(BlackMarketBlip, Config.Location.SetBlipScale) 26 | SetBlipAsShortRange(BlackMarketBlip, true) 27 | SetBlipColour(BlackMarketBlip, Config.Location.SetBlipColour) 28 | BeginTextCommandSetBlipName("STRING") 29 | AddTextComponentSubstringPlayerName(Config.Location.BlipName) 30 | EndTextCommandSetBlipName(BlackMarketBlip) 31 | end 32 | 33 | local Coords = Config.Location.Coords 34 | local PedHash = Config.Location.ModelHash 35 | local PedModel = Config.Location.ModelName 36 | 37 | if not DoesEntityExist(TRClassicBlackMarketPed) then 38 | RequestModel(GetHashKey(PedModel)) 39 | while not HasModelLoaded(GetHashKey(PedModel)) do 40 | Wait(1) 41 | end 42 | 43 | TRClassicBlackMarketPed = CreatePed(1, PedHash, Coords, false, true) 44 | FreezeEntityPosition(TRClassicBlackMarketPed, true) 45 | SetEntityInvincible(TRClassicBlackMarketPed, true) 46 | SetBlockingOfNonTemporaryEvents(TRClassicBlackMarketPed, true) 47 | end 48 | 49 | if itemCheck then 50 | exports['qb-target']:AddEntityZone('TRPed'..TRClassicBlackMarketPed, TRClassicBlackMarketPed, { 51 | name = 'TRPed'..TRClassicBlackMarketPed, 52 | heading = GetEntityHeading(TRClassicBlackMarketPed), 53 | debugPoly = false, 54 | item = Config.Item, 55 | }, { 56 | options = { 57 | { 58 | icon = Config.Icons["Eyeicon"], 59 | label = Config.Text["TargetLabel"], 60 | event = "tr-blackmarket:OpenShop", 61 | canInteract = function(entity) 62 | if IsPedDeadOrDying(entity, true) or IsPedAPlayer(entity) or IsPedInAnyVehicle(PlayerPedId(), false) then return false end 63 | return true 64 | end, 65 | }, 66 | }, 67 | distance = 1.5 68 | }) 69 | else 70 | exports['qb-target']:AddTargetEntity(TRClassicBlackMarketPed, { 71 | options = { 72 | { 73 | num = 1, 74 | type = "client", 75 | event = "tr-blackmarket:OpenShop", 76 | label = Config.Text["TargetLabel"], 77 | icon = Config.Icons["Eyeicon"] 78 | } 79 | }, 80 | distance = 1.5 81 | }) 82 | end 83 | end) 84 | 85 | -- qb-menu 86 | RegisterNetEvent('tr-blackmarket:OpenShop', function() 87 | local BlackMarket = { 88 | { header = Config.Text['PedHeader'], isMenuHeader = true, icon = Config.Icons["Header"] }, 89 | { header = Config.Text['Pistols'], icon = Config.Icons['Pistol'], params = { event = "tr-blackmarket:PistolShop" } }, 90 | { header = Config.Text['SubMachineGuns'], icon = Config.Icons['SubMachineGuns'], params = { event = "tr-blackmarket:SubMachineGunsShop" } }, 91 | { header = Config.Text['Shotguns'], icon = Config.Icons['Shotguns'], params = { event = "tr-blackmarket:ShotGunsShop" } }, 92 | { header = Config.Text['AssaultWeapons'], icon = Config.Icons['AssaultWeapons'], params = { event = "tr-blackmarket:AssaultWeaponsShop" } }, 93 | { header = Config.Text['Miscellanceous'], icon = Config.Icons['Miscellanceous'], params = { event = "tr-blackmarket:MiscellanceousShop" } } 94 | } 95 | exports['qb-menu']:openMenu(BlackMarket) 96 | end) 97 | 98 | -- BlackMarket Shop Event 99 | RegisterNetEvent("tr-blackmarket:PistolShop", function() 100 | TriggerServerEvent("inventory:server:OpenInventory", "shop", "market", Config.PistolShop) 101 | end) 102 | 103 | RegisterNetEvent("tr-blackmarket:SubMachineGunsShop", function() 104 | TriggerServerEvent("inventory:server:OpenInventory", "shop", "market", Config.SubMachineGunShop) 105 | end) 106 | 107 | RegisterNetEvent("tr-blackmarket:ShotGunsShop", function() 108 | TriggerServerEvent("inventory:server:OpenInventory", "shop", "market", Config.ShotGunShop) 109 | end) 110 | 111 | RegisterNetEvent("tr-blackmarket:AssaultWeaponsShop", function() 112 | TriggerServerEvent("inventory:server:OpenInventory", "shop", "market", Config.AssaultWeaponsShop) 113 | end) 114 | 115 | RegisterNetEvent("tr-blackmarket:MiscellanceousShop", function() 116 | TriggerServerEvent("inventory:server:OpenInventory", "shop", "market", Config.MiscellanceousShop) 117 | end) 118 | -------------------------------------------------------------------------------- /Config.lua: -------------------------------------------------------------------------------- 1 | Config = {} 2 | 3 | Config.UseBlip = true -- [true to enable the blip | false disables the blip] 4 | Config.ItemCheck = false -- true for item check / false for no item 5 | Config.Item = 'itemhere' 6 | 7 | Config.Location = { 8 | Coords = vector4(-279.14, 2206.02, 129.85 - 1.00, 67.35), 9 | ModelName = "a_m_y_epsilon_02", 10 | ModelHash = 0xAA82FF9B, 11 | SetBlipSprite = 303, 12 | SetBlipDisplay = 6, 13 | SetBlipScale = 0.85, 14 | SetBlipColour = 40, 15 | BlipName = "BlackMarket Dealer" 16 | } 17 | 18 | Config.Icons = { 19 | EyeIcon = "fa-solid fa-face-smile-horns", 20 | Header = "fa-solid fa-person-rifle", 21 | Pistol = "fa-solid fa-gun", 22 | SubMachineGuns = "fa-solid fa-gun", 23 | Shotguns = "fa-solid fa-gun", 24 | AssaultWeapons = "fa-solid fa-gun", 25 | Miscellanceous = "fa-solid fa-icons" 26 | } 27 | 28 | Config.Text = { 29 | TargetLabel = "BlackMarket Seller", 30 | PedHeader = "BlackMarket Dealer", 31 | Pistols = "Pistols", 32 | SubMachineGuns = "SubMachine Guns", 33 | Shotguns = "Shotguns", 34 | AssaultWeapons = "Assault Rifles", 35 | Miscellanceous = "Miscellanceous", 36 | 37 | } 38 | 39 | Config.PistolShop = { 40 | label = "Black Market Pistols", 41 | slots = 10, 42 | items = { 43 | [1] = { 44 | name = "weapon_pistol", 45 | price = 3000, 46 | amount = 100, 47 | info = { quality = 100, }, 48 | type = "item", 49 | slot = 1, 50 | }, 51 | [2] = { 52 | name = "weapon_pistol_mk2", 53 | price = 1600, 54 | amount = 100, 55 | info = { quality = 100, }, 56 | type = "item", 57 | slot = 2, 58 | }, 59 | [3] = { 60 | name = "weapon_heavypistol", 61 | price = 3000, 62 | amount = 100, 63 | info = { quality = 100, }, 64 | type = "item", 65 | slot = 3, 66 | }, 67 | [4] = { 68 | name = "weapon_marksmanpistol", 69 | price = 5000, 70 | amount = 100, 71 | info = { quality = 100, }, 72 | type = "item", 73 | slot = 4, 74 | }, 75 | [5] = { 76 | name = "weapon_snspistol_mk2", 77 | price = 5000, 78 | amount = 100, 79 | info = { quality = 100, }, 80 | type = "item", 81 | slot = 5, 82 | }, 83 | [6] = { 84 | name = "weapon_navyrevolver", 85 | price = 5000, 86 | amount = 100, 87 | info = { quality = 100, }, 88 | type = "item", 89 | slot = 6, 90 | } 91 | } 92 | } 93 | 94 | Config.SubMachineGunShop = { 95 | label = "Black Market SubMachine Guns", 96 | slots = 10, 97 | items = { 98 | [1] = { 99 | name = "weapon_microsmg", 100 | price = 5000, 101 | amount = 100, 102 | info = { quality = 100, }, 103 | type = "item", 104 | slot = 1, 105 | }, 106 | [2] = { 107 | name = "weapon_smg_mk2", 108 | price = 6000, 109 | amount = 100, 110 | info = { quality = 100, }, 111 | type = "item", 112 | slot = 2, 113 | }, 114 | [3] = { 115 | name = "weapon_assaultsmg", 116 | price = 6500, 117 | amount = 100, 118 | info = { quality = 100, }, 119 | type = "item", 120 | slot = 3, 121 | }, 122 | [4] = { 123 | name = "weapon_combatpdw", 124 | price = 6000, 125 | amount = 100, 126 | info = { quality = 100, }, 127 | type = "item", 128 | slot = 4, 129 | }, 130 | [5] = { 131 | name = "weapon_machinepistol", 132 | price = 5000, 133 | amount = 100, 134 | info = { quality = 100, }, 135 | type = "item", 136 | slot = 5, 137 | }, 138 | [6] = { 139 | name = "weapon_minismg", 140 | price = 5000, 141 | amount = 100, 142 | info = { quality = 100, }, 143 | type = "item", 144 | slot = 6, 145 | } 146 | } 147 | } 148 | 149 | Config.ShotGunShop = { 150 | label = "Black Market ShotGuns", 151 | slots = 10, 152 | items = { 153 | [1] = { 154 | name = "weapon_pumpshotgun", 155 | price = 12000, 156 | amount = 100, 157 | info = { quality = 100, }, 158 | type = "item", 159 | slot = 1, 160 | }, 161 | [2] = { 162 | name = "weapon_sawnoffshotgun", 163 | price = 8000, 164 | amount = 100, 165 | info = { quality = 100, }, 166 | type = "item", 167 | slot = 2, 168 | }, 169 | [3] = { 170 | name = "weapon_bullpupshotgun", 171 | price = 12500, 172 | amount = 100, 173 | info = { quality = 100, }, 174 | type = "item", 175 | slot = 3, 176 | }, 177 | [4] = { 178 | name = "weapon_dbshotgun", 179 | price = 13000, 180 | amount = 100, 181 | info = { quality = 100, }, 182 | type = "item", 183 | slot = 4, 184 | }, 185 | [5] = { 186 | name = "weapon_heavyshotgun", 187 | price = 15000, 188 | amount = 100, 189 | info = { quality = 100, }, 190 | type = "item", 191 | slot = 5, 192 | }, 193 | [6] = { 194 | name = "weapon_pumpshotgun_mk2", 195 | price = 10000, 196 | amount = 100, 197 | info = { quality = 100, }, 198 | type = "item", 199 | slot = 6, 200 | } 201 | } 202 | } 203 | 204 | Config.AssaultWeaponsShop = { 205 | label = "Black Market Assault Weapon Shop", 206 | slots = 10, 207 | items = { 208 | [1] = { 209 | name = "weapon_assaultrifle", 210 | price = 26000, 211 | amount = 100, 212 | info = { quality = 100, }, 213 | type = "item", 214 | slot = 1, 215 | }, 216 | [2] = { 217 | name = "weapon_assaultrifle_mk2", 218 | price = 30000, 219 | amount = 100, 220 | info = { quality = 100, }, 221 | type = "item", 222 | slot = 2, 223 | }, 224 | [3] = { 225 | name = "weapon_carbinerifle_mk2", 226 | price = 42000, 227 | amount = 100, 228 | info = { quality = 100, }, 229 | type = "item", 230 | slot = 3, 231 | }, 232 | [4] = { 233 | name = "weapon_compactrifle", 234 | price = 28500, 235 | amount = 100, 236 | info = { quality = 100, }, 237 | type = "item", 238 | slot = 4, 239 | }, 240 | [5] = { 241 | name = "weapon_advancedrifle", 242 | price = 32000, 243 | amount = 100, 244 | info = { quality = 100, }, 245 | type = "item", 246 | slot = 5, 247 | }, 248 | [6] = { 249 | name = "weapon_bullpuprifle_mk2", 250 | price = 36000, 251 | amount = 100, 252 | info = { quality = 100, }, 253 | type = "item", 254 | slot = 6, 255 | } 256 | } 257 | } 258 | 259 | Config.MiscellanceousShop = { 260 | label = "Black Market Miscellanceous Shop", 261 | slots = 10, 262 | items = { 263 | [1] = { 264 | name = "armor", 265 | price = 10000, 266 | amount = 100, 267 | info = { quality = 100, }, 268 | type = "item", 269 | slot = 1, 270 | }, 271 | [2] = { 272 | name = "heavyarmor", 273 | price = 15000, 274 | amount = 100, 275 | info = { quality = 100, }, 276 | type = "item", 277 | slot = 2, 278 | }, 279 | [3] = { 280 | name = "labkey", 281 | price = 30000, 282 | amount = 100, 283 | info = { quality = 100, }, 284 | type = "item", 285 | slot = 3, 286 | }, 287 | [4] = { 288 | name = "trojan_usb", 289 | price = 75000, 290 | amount = 100, 291 | info = { quality = 100, }, 292 | type = "item", 293 | slot = 4, 294 | }, 295 | [5] = { 296 | name = "thermite", 297 | price = 200000, 298 | amount = 100, 299 | info = { quality = 100, }, 300 | type = "item", 301 | slot = 5, 302 | }, 303 | [6] = { 304 | name = "drill", 305 | price = 175000, 306 | amount = 100, 307 | info = { quality = 100, }, 308 | type = "item", 309 | slot = 6, 310 | }, 311 | [7] = { 312 | name = "advancedlockpick", 313 | price = 5000, 314 | amount = 100, 315 | info = { quality = 100, }, 316 | type = "item", 317 | slot = 7, 318 | }, 319 | [8] = { 320 | name = "gatecrack", 321 | price = 950000, 322 | amount = 100, 323 | info = { quality = 100, }, 324 | type = "item", 325 | slot = 8, 326 | }, 327 | [9] = { 328 | name = "pistol_ammo", 329 | price = 100, 330 | amount = 100, 331 | info = { quality = 100, }, 332 | type = "item", 333 | slot = 9, 334 | }, 335 | [10] = { 336 | name = "rifle_ammo", 337 | price = 1500, 338 | amount = 100, 339 | info = { quality = 100, }, 340 | type = "item", 341 | slot = 10, 342 | }, 343 | [11] = { 344 | name = "smg_ammo", 345 | price = 1000, 346 | amount = 100, 347 | info = { quality = 100, }, 348 | type = "item", 349 | slot = 11, 350 | }, 351 | [12] = { 352 | name = "shotgun_ammo", 353 | price = 2000, 354 | amount = 100, 355 | info = { quality = 100, }, 356 | type = "item", 357 | slot = 12, 358 | }, 359 | } 360 | } 361 | --------------------------------------------------------------------------------