├── images ├── meat.png ├── leather.png ├── huntingbait.png ├── huntingcarcass1.png ├── huntingcarcass2.png ├── huntingcarcass3.png └── huntingcarcass4.png ├── cl_sell.lua ├── client ├── cl_init.lua ├── cl_aimblock.lua ├── cl_sell.lua └── cl_main.lua ├── LICENSE ├── fxmanifest.lua ├── shared.lua ├── html └── index.html ├── server.lua └── README.md /images/meat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leuxum/leuxums-qbhunting/HEAD/images/meat.png -------------------------------------------------------------------------------- /images/leather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leuxum/leuxums-qbhunting/HEAD/images/leather.png -------------------------------------------------------------------------------- /images/huntingbait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leuxum/leuxums-qbhunting/HEAD/images/huntingbait.png -------------------------------------------------------------------------------- /images/huntingcarcass1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leuxum/leuxums-qbhunting/HEAD/images/huntingcarcass1.png -------------------------------------------------------------------------------- /images/huntingcarcass2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leuxum/leuxums-qbhunting/HEAD/images/huntingcarcass2.png -------------------------------------------------------------------------------- /images/huntingcarcass3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leuxum/leuxums-qbhunting/HEAD/images/huntingcarcass3.png -------------------------------------------------------------------------------- /images/huntingcarcass4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leuxum/leuxums-qbhunting/HEAD/images/huntingcarcass4.png -------------------------------------------------------------------------------- /cl_sell.lua: -------------------------------------------------------------------------------- 1 | IGNORE THIS FILE, YOU ARE ABLE TO DELETE IT 2 | THE CLIENT SELL SCRIPT IS IN THE CLIENT/CL_SELL THIS WAS AN ACCIDENTAL DUPLICATE 3 | -------------------------------------------------------------------------------- /client/cl_init.lua: -------------------------------------------------------------------------------- 1 | --Citizen.CreateThread(function() 2 | -- exports["PolyZone"]:AddCircleZone("huntingsales", vector3(-773.28, 5596.95, 33.49), 2.0, { 3 | -- useZ = true, 4 | -- debugPoly= true, 5 | -- }) 6 | --end) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YOU HAVE NO LEGAL RIGHT TO SELL/DISTRUBIUTE THIS SCRIPT TO CLAIM AS YOUR OWN 2 | 3 | YOU HAVE LEGAL RIGHT TO EDIT THIS SCRIPT FOR YOUR OWN SERVER TO BETTER SUIT IT 4 | 5 | -------------------------------------------------------------------------------- /fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'bodacious' 2 | game 'gta5' 3 | 4 | client_script { 5 | '@PolyZone/client.lua', 6 | '@PolyZone/CircleZone.lua', 7 | '@PolyZone/BoxZone.lua', 8 | '@PolyZone/EntityZone.lua', 9 | '@PolyZone/CircleZone.lua', 10 | '@PolyZone/ComboZone.lua', 11 | 'client/cl_*.lua', 12 | 'cl_main.lua', 13 | 'cl_aimblock', 14 | 'cl_init.lua', 15 | 'cl_sell.lua' 16 | 17 | } 18 | server_script 'server.lua' 19 | 20 | shared_scripts { 21 | '@qb-core/shared.lua' 22 | } 23 | 24 | files{ 25 | 'html/*' 26 | } 27 | 28 | ui_page('html/index.html') -------------------------------------------------------------------------------- /shared.lua: -------------------------------------------------------------------------------- 1 | Config = {} 2 | 3 | Config.BaitCooldown = 1 4 | 5 | --Config.EnableShopBlip = false 6 | 7 | Config.TimeBeforeBaitStarts = 5000 -- (20000 = 20 seconds, this is to give the player enough time to move away from the bait ) 8 | Config.GiveOtherItem = false -- If you want to give other item or not 9 | --Config.DistanceAnimalsSpook = 1 -- Distance the player can get to a baited target before it runs(Mtlions will attack at this range) 10 | 11 | --Config.EnablePoaching = false 12 | Config.IllegalPelt = 'illegalcarcass' 13 | 14 | --Config.HuntingAnimals = {'a_c_boar','a_c_deer','a_c_coyote','a_c_mtlion'} 15 | 16 | --Config.UseZones = true -- If true, Only allow hunting in specific Zones 17 | --Config.Zones = { 18 | -- 'MTCHIL', 19 | -- 'CANNY', 20 | -- 'MTGORDO', 21 | -- 'CMSW', 22 | -- 'MTJOSE' 23 | --} -------------------------------------------------------------------------------- /html/index.html: -------------------------------------------------------------------------------- 1 | 2 | Hunting Scope 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /client/cl_aimblock.lua: -------------------------------------------------------------------------------- 1 | 2 | 3 | local hasHuntingRifle = false 4 | local isFreeAiming = false 5 | 6 | local function processScope(freeAiming) 7 | if not isFreeAiming and freeAiming then 8 | isFreeAiming = true 9 | TriggerEvent("hidexhair") 10 | SendNUIMessage({ 11 | display = true, 12 | }) 13 | elseif isFreeAiming and not freeAiming then 14 | isFreeAiming = false 15 | SendNUIMessage({ 16 | display = false, 17 | }) 18 | end 19 | end 20 | 21 | local blockShotActive = false 22 | local function blockShooting() 23 | if blockShotActive then return end 24 | blockShotActive = true 25 | Citizen.CreateThread(function() 26 | while hasHuntingRifle do 27 | local ply = PlayerId() 28 | local ped = PlayerPedId() 29 | local ent = nil 30 | local aiming, ent = GetEntityPlayerIsFreeAimingAt(ply) 31 | local freeAiming = IsPlayerFreeAiming(ply) 32 | processScope(freeAiming) 33 | local et = GetEntityType(ent) 34 | if not freeAiming 35 | or IsPedAPlayer(ent) 36 | or et == 2 37 | or (et == 1 and IsPedInAnyVehicle(ent)) 38 | then 39 | DisableControlAction(0, 24, true) 40 | DisableControlAction(0, 47, true) 41 | DisableControlAction(0, 58, true) 42 | DisablePlayerFiring(ped, true) 43 | end 44 | Citizen.Wait(0) 45 | end 46 | blockShotActive = false 47 | processScope(false) 48 | end) 49 | end 50 | 51 | Citizen.CreateThread(function() 52 | local huntingRifleHash = `weapon_sniperrifle2` -- -646649097 53 | 54 | while true do 55 | if GetSelectedPedWeapon(PlayerPedId()) == huntingRifleHash then 56 | hasHuntingRifle = true 57 | blockShooting() 58 | else 59 | hasHuntingRifle = false 60 | end 61 | Citizen.Wait(1000) 62 | end 63 | end) 64 | 65 | 66 | -------------------------------------------------------------------------------- /client/cl_sell.lua: -------------------------------------------------------------------------------- 1 | local carcasses = { 2 | { name = "huntingcarcass1", price = 100, illegal = false }, 3 | { name = "huntingcarcass2", price = 175, illegal = false }, 4 | { name = "huntingcarcass3", price = 225, illegal = false }, 5 | { name = "huntingcarcass4", price = 300, illegal = false }, 6 | { name = "meat", price = 25, illegal = false }, 7 | { name = "leather", price = 50, illegal = false }, 8 | { name = "deercarcass1", price = 125, illegal = false }, 9 | { name = "deercarcass2", price = 195, illegal = false }, 10 | { name = "deercarcass3", price = 275, illegal = false }, 11 | { name = "deercarcass4", price = 350, illegal = false }, 12 | { name = "boarcarcass1", price = 50, illegal = false }, 13 | { name = "boarcarcass2", price = 50, illegal = false }, 14 | { name = "boarcarcass3", price = 50, illegal = false }, 15 | { name = "boarcarcass4", price = 50, illegal = false }, 16 | { name = "wolfcarcass1", price = 50, illegal = false }, 17 | } 18 | 19 | local illegalcarcasses = { 20 | { name = "illegalcarcass1", price = 300, illegal = false }, 21 | { name = "illegalcarcass2", price = 500, illegal = false }, 22 | { name = "illegalcarcass3", price = 700, illegal = false }, 23 | { name = "illegalcarcass4", price = 1100, illegal = false }, 24 | { name = "meat", price = 45, illegal = false }, 25 | { name = "rareleather", price = 55, illegal = false }, 26 | { name = "chimpcarcass1", price = 150, illegal = false }, 27 | { name = "chimpcarcass2", price = 300, illegal = false }, 28 | { name = "chimpcarcass3", price = 450, illegal = false }, 29 | { name = "chimpcarcass4", price = 750, illegal = false }, 30 | { name = "bigfootfur", price = 1500, illegal = false }, 31 | { name = "leather1", price = 100, illegal = false }, 32 | } 33 | 34 | 35 | local function sellAnimals() 36 | TriggerServerEvent("Leux-hunting:server:sell") 37 | end 38 | 39 | local listening = false 40 | local function listenForKeypress() 41 | listening = true 42 | Citizen.CreateThread(function() 43 | while listening do 44 | if IsControlJustReleased(0, 38) then 45 | listening = false 46 | exports["aw3-ui"]:hideInteraction() 47 | sellAnimals() 48 | end 49 | Wait(0) 50 | end 51 | end) 52 | end 53 | 54 | local huntingsales = false 55 | AddEventHandler("polyzonehelper:enter", function(name) 56 | if name ~= "huntingsales" then return end 57 | exports["aw3-ui"]:showInteraction("[E] Sell Animal Carcass") 58 | listenForKeypress() 59 | end) 60 | 61 | AddEventHandler("polyzonehelper:exit", function(name) 62 | if name ~= "huntingsales" then return end 63 | exports["aw3-ui"]:hideInteraction() 64 | listening = false 65 | end) 66 | 67 | function isNight() 68 | local hour = GetClockHours() 69 | if hour > 21 or hour < 3 then 70 | return true 71 | end 72 | end 73 | 74 | local function sellPoachedAnimals() 75 | TriggerServerEvent("Leux-hunting:server:sellpoached") 76 | end -------------------------------------------------------------------------------- /server.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | 3 | RegisterServerEvent('Leux-hunting:skinReward') 4 | AddEventHandler('Leux-hunting:skinReward', function() 5 | local src = source 6 | local Player = QBCore.Functions.GetPlayer(src) 7 | local randomAmount = math.random(1,30) 8 | if randomAmount > 1 and randomAmount < 15 then 9 | Player.Functions.AddItem("huntingcarcass1", 1) 10 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["huntingcarcass1"], "add") 11 | Player.Functions.AddItem("meat", 2) 12 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 13 | elseif randomAmount > 15 and randomAmount < 23 then 14 | Player.Functions.AddItem("huntingcarcass2", 1) 15 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["huntingcarcass2"], "add") 16 | Player.Functions.AddItem("meat", 5) 17 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 18 | elseif randomAmount > 23 and randomAmount < 29 then 19 | Player.Functions.AddItem("huntingcarcass3", 1) 20 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["huntingcarcass3"], "add") 21 | Player.Functions.AddItem("meat", 8) 22 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 23 | else 24 | Player.Functions.AddItem("huntingcarcass4", 1) 25 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["huntingcarcass4"], "add") 26 | Player.Functions.AddItem("meat", 10) 27 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 28 | end 29 | 30 | TriggerClientEvent('player:receiveItem', _source, 'meat',math.random(1,10)) 31 | end) 32 | 33 | RegisterServerEvent('Leux-hunting:removeBait') 34 | AddEventHandler('Leux-hunting:removeBait', function() 35 | local src = source 36 | local Player = QBCore.Functions.GetPlayer(src) 37 | Player.Functions.RemoveItem("huntingbait", 1) 38 | end) 39 | 40 | RegisterServerEvent('Leux-hunting:removepoachingBait') 41 | AddEventHandler('Leux-hunting:removepoachingBait', function() 42 | local src = source 43 | local Player = QBCore.Functions.GetPlayer(src) 44 | Player.Functions.RemoveItem("poachingbait", 1) 45 | end) 46 | 47 | RegisterServerEvent('remove:money') 48 | AddEventHandler('remove:money', function(totalCash) 49 | local src = source 50 | local Player = DoxCore.Functions.GetPlayer(src) 51 | if Player.PlayerData.money['cash'] >= (150) then 52 | Player.Functions.RemoveMoney('cash', 150) 53 | TriggerClientEvent("Leux-hunting:setammo", src) 54 | TriggerClientEvent("QBCore:Notify", src, 'Reloaded.') 55 | else 56 | TriggerClientEvent("QBCore:Notify", src, 'Not enough cash on you.', 'error') 57 | end 58 | end) 59 | 60 | QBCore.Functions.CreateUseableItem("huntingbait", function(source, item) 61 | local Player = QBCore.Functions.GetPlayer(source) 62 | 63 | TriggerClientEvent('Leux-hunting:usedBait', source) 64 | end) 65 | 66 | QBCore.Functions.CreateUseableItem("poachingbait", function(source, item) 67 | local Player = QBCore.Functions.GetPlayer(source) 68 | 69 | TriggerClientEvent('Leux-hunting:usedPoaching', source) 70 | end) 71 | 72 | local carcasses = { 73 | huntingcarcass1 = 200, 74 | huntingcarcass2 = 300, 75 | huntingcarcass3 = 400, 76 | huntingcarcass4 = 550, 77 | meat = 25, 78 | leather = 50, 79 | deercarcass1 = 125, 80 | deercarcass2 = 235, 81 | deercarcass3 = 450, 82 | deercarcass4 = 550, 83 | boarcarcass1 = 125, 84 | boarcarcass2 = 250, 85 | boarcarcass3 = 290, 86 | boarcarcass4 = 450, 87 | wolfcarcass1 = 75, 88 | wolfcarcass2 = 120, 89 | wolfcarcass3 = 230, 90 | wolfcarcass4 = 300, 91 | mtlioncarcass1 = 200, 92 | mtlioncarcass2 = 275, 93 | mtlioncarcass3 = 320, 94 | mtlioncarcass4 = 495 95 | } 96 | 97 | local illegalcarcasses = { 98 | illegalcarcass1 = 225, 99 | illegalcarcass2 = 325, 100 | illegalcarcass3 = 450, 101 | illegalcarcass4 = 500, 102 | meat = 45, 103 | chimpcarcass1 = 225, 104 | chimpcarcass2 = 325, 105 | chimpcarcass3 = 450, 106 | chimpcarcass4 = 595, 107 | bigfootfur = 1500 108 | } 109 | 110 | RegisterServerEvent('Leux-hunting:server:sell') 111 | AddEventHandler('Leux-hunting:server:sell', function() 112 | local src = source 113 | local Player = QBCore.Functions.GetPlayer(src) 114 | for k,v in pairs(carcasses) do 115 | local item = Player.Functions.GetItemByName(k) 116 | if item ~= nil then 117 | if Player.Functions.RemoveItem(k, item.amount) then 118 | Player.Functions.AddMoney('cash', v * item.amount) 119 | end 120 | end 121 | end 122 | end) 123 | 124 | RegisterServerEvent('Leux-hunting:server:sellpoached') 125 | AddEventHandler('Leux-hunting:server:sellpoached', function() 126 | local src = source 127 | local Player = QBCore.Functions.GetPlayer(src) 128 | for k,v in pairs(illegalcarcasses) do 129 | local item = Player.Functions.GetItemByName(k) 130 | if item ~= nil then 131 | if Player.Functions.RemoveItem(k, item.amount) then 132 | Player.Functions.AddMoney('cash', v * item.amount) 133 | end 134 | end 135 | end 136 | end) 137 | 138 | RegisterServerEvent('Leux-hunting:poachingchimpReward') 139 | AddEventHandler('Leux-hunting:poachingchimpReward', function() 140 | local src = source 141 | local Player = QBCore.Functions.GetPlayer(src) 142 | local randomAmount = math.random(1,30) 143 | if randomAmount > 1 and randomAmount < 15 then 144 | Player.Functions.AddItem("chimpcarcass1", 1) 145 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["chimpcarcass1"], "add") 146 | Player.Functions.AddItem("meat", 1) 147 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 148 | elseif randomAmount > 15 and randomAmount < 23 then 149 | Player.Functions.AddItem("chimpcarcass2", 1) 150 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["chimpcarcass2"], "add") 151 | Player.Functions.AddItem("meat", 2) 152 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 153 | elseif randomAmount > 23 and randomAmount < 29 then 154 | Player.Functions.AddItem("chimpcarcass3", 1) 155 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["chimpcarcass3"], "add") 156 | Player.Functions.AddItem("meat", 4) 157 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 158 | else 159 | Player.Functions.AddItem("chimpcarcass4", 1) 160 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["chimpcarcass4"], "add") 161 | Player.Functions.AddItem("meat", 5) 162 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 163 | end 164 | 165 | TriggerClientEvent('player:receiveItem', _source, 'meat',math.random(1,10)) 166 | end) 167 | 168 | RegisterServerEvent('Leux-hunting:deerReward') 169 | AddEventHandler('Leux-hunting:deerReward', function() 170 | local src = source 171 | local Player = QBCore.Functions.GetPlayer(src) 172 | local randomAmount = math.random(1,30) 173 | if randomAmount > 1 and randomAmount < 15 then 174 | Player.Functions.AddItem("deercarcass1", 1) 175 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["deercarcass1"], "add") 176 | Player.Functions.AddItem("meat", 1) 177 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 178 | Player.Functions.AddItem("leather", 1) 179 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 180 | elseif randomAmount > 15 and randomAmount < 23 then 181 | Player.Functions.AddItem("deercarcass2", 1) 182 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["deercarcass2"], "add") 183 | Player.Functions.AddItem("meat", 2) 184 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 185 | Player.Functions.AddItem("leather", 1) 186 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 187 | elseif randomAmount > 23 and randomAmount < 29 then 188 | Player.Functions.AddItem("deercarcass3", 1) 189 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["deercarcass3"], "add") 190 | Player.Functions.AddItem("meat", 4) 191 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 192 | Player.Functions.AddItem("leather", 2) 193 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 194 | else 195 | Player.Functions.AddItem("deercarcass4", 1) 196 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["deercarcass4"], "add") 197 | Player.Functions.AddItem("meat", 5) 198 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 199 | Player.Functions.AddItem("leather", 3) 200 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 201 | end 202 | 203 | TriggerClientEvent('player:receiveItem', _source, 'meat',math.random(1,10)) 204 | end) 205 | 206 | RegisterServerEvent('Leux-hunting:boarReward') 207 | AddEventHandler('Leux-hunting:boarReward', function() 208 | local src = source 209 | local Player = QBCore.Functions.GetPlayer(src) 210 | local randomAmount = math.random(1,30) 211 | if randomAmount > 1 and randomAmount < 15 then 212 | Player.Functions.AddItem("boarcarcass1", 1) 213 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["boarcarcass1"], "add") 214 | Player.Functions.AddItem("meat", 1) 215 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 216 | Player.Functions.AddItem("leather", 1) 217 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 218 | elseif randomAmount > 15 and randomAmount < 23 then 219 | Player.Functions.AddItem("boarcarcass2", 1) 220 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["boarcarcass2"], "add") 221 | Player.Functions.AddItem("meat", 2) 222 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 223 | Player.Functions.AddItem("leather", 1) 224 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 225 | elseif randomAmount > 23 and randomAmount < 29 then 226 | Player.Functions.AddItem("boarcarcass3", 1) 227 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["boarcarcass3"], "add") 228 | Player.Functions.AddItem("meat", 4) 229 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 230 | Player.Functions.AddItem("leather", 1) 231 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 232 | else 233 | Player.Functions.AddItem("boarcarcass4", 1) 234 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["boarcarcass4"], "add") 235 | Player.Functions.AddItem("meat", 5) 236 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 237 | Player.Functions.AddItem("leather", 2) 238 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 239 | end 240 | 241 | TriggerClientEvent('player:receiveItem', _source, 'meat',math.random(1,10)) 242 | end) 243 | 244 | RegisterServerEvent('Leux-hunting:wolfReward') 245 | AddEventHandler('Leux-hunting:wolfReward', function() 246 | local src = source 247 | local Player = QBCore.Functions.GetPlayer(src) 248 | local randomAmount = math.random(1,30) 249 | if randomAmount > 1 and randomAmount < 15 then 250 | Player.Functions.AddItem("wolfcarcass1", 1) 251 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["wolfcarcass1"], "add") 252 | Player.Functions.AddItem("meat", 1) 253 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 254 | Player.Functions.AddItem("leather", 1) 255 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 256 | elseif randomAmount > 15 and randomAmount < 23 then 257 | Player.Functions.AddItem("wolfcarcass2", 1) 258 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["wolfcarcass2"], "add") 259 | Player.Functions.AddItem("meat", 2) 260 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 261 | Player.Functions.AddItem("leather", 1) 262 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 263 | elseif randomAmount > 23 and randomAmount < 29 then 264 | Player.Functions.AddItem("wolfcarcass3", 1) 265 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["wolfcarcass3"], "add") 266 | Player.Functions.AddItem("meat", 4) 267 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 268 | Player.Functions.AddItem("leather", 1) 269 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 270 | else 271 | Player.Functions.AddItem("wolfcarcass4", 1) 272 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["wolfcarcass4"], "add") 273 | Player.Functions.AddItem("meat", 5) 274 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 275 | Player.Functions.AddItem("leather", 1) 276 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 277 | end 278 | 279 | TriggerClientEvent('player:receiveItem', _source, 'meat',math.random(1,10)) 280 | end) 281 | 282 | RegisterServerEvent('Leux-hunting:bigfootReward') 283 | AddEventHandler('Leux-hunting:bigfootReward', function() 284 | local src = source 285 | local Player = QBCore.Functions.GetPlayer(src) 286 | local randomAmount = math.random(1,30) 287 | if randomAmount > 1 and randomAmount < 15 then 288 | Player.Functions.AddItem("illegalcarcass1", 2) 289 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["illegalcarcass1"], "add") 290 | Player.Functions.AddItem("meat", 3) 291 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 292 | Player.Functions.AddItem("leather", 1) 293 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 294 | elseif randomAmount > 15 and randomAmount < 23 then 295 | Player.Functions.AddItem("illegalcarcass2", 2) 296 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["illegalcarcass2"], "add") 297 | Player.Functions.AddItem("meat", 4) 298 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 299 | Player.Functions.AddItem("leather", 1) 300 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 301 | elseif randomAmount > 23 and randomAmount < 29 then 302 | Player.Functions.AddItem("illegalcarcass3", 2) 303 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["illegalcarcass3"], "add") 304 | Player.Functions.AddItem("meat", 5) 305 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 306 | Player.Functions.AddItem("leather", 1) 307 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 308 | else 309 | Player.Functions.AddItem("bigfootfur", 1) 310 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["bigfootfur"], "add") 311 | Player.Functions.AddItem("meat", 7) 312 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 313 | Player.Functions.AddItem("leather1", 4) 314 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather1"], "add") 315 | end 316 | 317 | TriggerClientEvent('player:receiveItem', _source, 'meat',math.random(1,10)) 318 | end) 319 | 320 | RegisterServerEvent('Leux-hunting:mountainlionReward') 321 | AddEventHandler('Leux-hunting:mountainlionreward', function() 322 | local src = source 323 | local Player = QBCore.Functions.GetPlayer(src) 324 | local randomAmount = math.random(1,30) 325 | if randomAmount > 1 and randomAmount < 15 then 326 | Player.Functions.AddItem("mtlioncarcass1", 1) 327 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["mtlioncarcass1"], "add") 328 | Player.Functions.AddItem("meat", 3) 329 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 330 | Player.Functions.AddItem("leather", 1) 331 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 332 | elseif randomAmount > 15 and randomAmount < 23 then 333 | Player.Functions.AddItem("mtlioncarcass2", 1) 334 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["mtlioncarcass2"], "add") 335 | Player.Functions.AddItem("meat", 4) 336 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 337 | Player.Functions.AddItem("leather", 1) 338 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 339 | elseif randomAmount > 23 and randomAmount < 29 then 340 | Player.Functions.AddItem("mtlioncarcass3", 1) 341 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["mtlioncarcass3"], "add") 342 | Player.Functions.AddItem("meat", 5) 343 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 344 | Player.Functions.AddItem("leather", 1) 345 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather"], "add") 346 | else 347 | Player.Functions.AddItem("mtlioncarcass4", 1) 348 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["mtlioncarcass4"], "add") 349 | Player.Functions.AddItem("meat", 7) 350 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["meat"], "add") 351 | Player.Functions.AddItem("leather1", 1) 352 | TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["leather1"], "add") 353 | end 354 | 355 | TriggerClientEvent('player:receiveItem', _source, 'meat',math.random(1,10)) 356 | end) 357 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ![image](https://user-images.githubusercontent.com/68282622/160637413-8a9e686b-f1d2-4900-bf4b-4d717e852968.png) 3 | 4 | 5 | # leuxums-qbhunting based off of QBUS-NOPIXEL-HUNTING 6 | VERSION 0.2 7 | Discord: 8 | leuxum#4926 9 | 10 | Target 11 | 12 | 1. add this to your qb-target/init.lua (make sure its under Config.Peds) 13 | ``` 14 | ["Hunting"] = { 15 | model = 'ig_hunter', -- Change the ped to whatever you want (https://docs.fivem.net/docs/game-references/ped-models/) 16 | coords = vector4(-774.12, 5604.64, 33.74, 167.68), --Change the coords, Go to /admin, developer options and select vector4 17 | minusOne = true, 18 | freeze = true, 19 | invincible = true, 20 | blockevents = true, 21 | flag = 1, 22 | --scenario = 'WORLD_HUMAN_CLIPBOARD', 23 | target = { 24 | options = { 25 | { 26 | item = 'weaponlicense', 27 | type = "client", 28 | event = "qb-shops:marketshop", 29 | icon = "fas fa-shopping-cart", 30 | label = "Open Shop", 31 | }, 32 | { 33 | type = "server", 34 | event = "Leux-hunting:server:sell", 35 | icon = "fas fa-circle", 36 | label = "Sell", 37 | }, 38 | }, 39 | }, 40 | distance = 3.5, 41 | }, 42 | 43 | ["doggydave"] = { 44 | model = 'cs_karen_daniels', -- Change the ped to whatever you want (https://docs.fivem.net/docs/game-references/ped-models/) 45 | coords = vector4(186.3, -583.21, 43.87, 192.59), --Change the coords, Go to /admin, developer options and select vector4 46 | minusOne = true, 47 | freeze = true, 48 | invincible = true, 49 | blockevents = true, 50 | flag = 1, 51 | --scenario = 'WORLD_HUMAN_CLIPBOARD', 52 | target = { 53 | options = { 54 | { 55 | type = "client", 56 | event = "qb-shops:marketsho", 57 | targeticon = "fas fa-shopping-bag", 58 | label = 'I need some special animals for testing, up for the job?', 59 | }, 60 | { 61 | type = "client", 62 | event = "qb-shops:marketshop", 63 | targeticon = "fas fa-shopping-bag", 64 | label = 'Doggy Daves Appliances', 65 | }, 66 | { 67 | type = "server", 68 | event = "Leux-hunting:server:sellpoached", 69 | targeticon = "fas fa-shopping-bag", 70 | label = 'Sell', 71 | }, 72 | }, 73 | }, 74 | distance = 3.5, 75 | }, 76 | 77 | ``` 78 | add this to your qb-target/init.lua (make sure that its under Config.TargetModels 79 | ``` 80 | ["animal1"] = { 81 | models = { 82 | "a_c_boar" 83 | }, 84 | options = { 85 | { 86 | item = 'weapon_knife', 87 | type = "client", 88 | event = "Leux-hunting:boarAnimal", 89 | targeticon = "far fa-hand-paper", 90 | label = 'Skin Boar', 91 | }, 92 | }, 93 | distance = 3.5, 94 | }, 95 | ["huntinganimal2"] = { 96 | models = { 97 | "a_c_deer" 98 | }, 99 | options = { 100 | { 101 | item = 'weapon_knife', 102 | type = "client", 103 | event = "Leux-hunting:deerAnimal", 104 | targeticon = "far fa-hand-paper", 105 | label = 'Skin Deer', 106 | }, 107 | }, 108 | distance = 3.5, 109 | }, 110 | ["huntinganimal3"] = { 111 | models = { 112 | "a_c_coyote" 113 | }, 114 | options = { 115 | { 116 | item = 'weapon_knife', 117 | type = "client", 118 | event = "Leux-hunting:wolfAnimal", 119 | targeticon = "far fa-hand-paper", 120 | label = 'Skin Coyote', 121 | }, 122 | }, 123 | distance = 3.5, 124 | }, 125 | ["huntinganimal4"] = { 126 | models = { 127 | "a_c_mtlion" 128 | }, 129 | options = { 130 | { 131 | item = 'weapon_knife', 132 | type = "client", 133 | event = "Leux-hunting:skinmtlion", 134 | targeticon = "far fa-hand-paper", 135 | label = 'Skin Mountain Lion', 136 | }, 137 | }, 138 | distance = 3.5, 139 | }, 140 | ["poachedanimal1"] = { 141 | models = { 142 | "a_c_chimp" 143 | }, 144 | options = { 145 | { 146 | item = 'weapon_knife', 147 | type = "client", 148 | event = "Leux-hunting:skinpoachedchimpanzeeAnimal", 149 | targeticon = "far fa-hand-paper", 150 | label = 'Skin Chimpanzee', 151 | }, 152 | }, 153 | distance = 3.5, 154 | }, 155 | ["poachedanimal2"] = { 156 | models = { 157 | "a_c_husky" 158 | }, 159 | options = { 160 | { 161 | item = 'weapon_knife', 162 | type = "client", 163 | event = "Leux-hunting:wolfAnimal", 164 | targeticon = "far fa-hand-paper", 165 | label = 'Skin Husky', 166 | }, 167 | }, 168 | distance = 3.5, 169 | }, 170 | ["poachedanimal3"] = { 171 | models = { 172 | "cs_orleans" 173 | }, 174 | options = { 175 | { 176 | type = "client", 177 | event = "Leux-hunting:skinbigfoot", 178 | targeticon = "far fa-hand-paper", 179 | label = 'Skin Bigfoot', 180 | }, 181 | }, 182 | distance = 3.5, 183 | }, 184 | ["poachedanimal4"] = { 185 | models = { 186 | "a_c_rhesus" 187 | }, 188 | options = { 189 | { 190 | type = "client", 191 | event = "Leux-hunting:skinpoachedchimpanzeeAnimal", 192 | targeticon = "far fa-hand-paper", 193 | label = 'Skin Chimpanzee', 194 | }, 195 | }, 196 | distance = 3.5, 197 | }, 198 | ``` 199 | 200 | 201 | Add to shared 202 | ``` 203 | -- Hunting Items 204 | ['meat'] = {['name'] = 'meat', ['label'] = 'Meat', ['weight'] = 100, ['type'] = 'item', ['image'] = 'meat.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to a certified hunter'}, 205 | ['leather'] = {['name'] = 'leather', ['label'] = 'Level 1 Leather ', ['weight'] = 200, ['type'] = 'item', ['image'] = 'leather.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to a certified hunter'}, 206 | ['huntingcarcass1'] = {['name'] = 'huntingcarcass1', ['label'] = 'Level 1 carcass', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingcarcass1.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to a certified hunter'}, 207 | ['huntingcarcass2'] = {['name'] = 'huntingcarcass2', ['label'] = 'Level 2 carcass', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingcarcass2.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to a certified hunter'}, 208 | ['huntingcarcass3'] = {['name'] = 'huntingcarcass3', ['label'] = 'Level 3 carcass', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingcarcass3.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to a certified hunter'}, 209 | ['huntingcarcass4'] = {['name'] = 'huntingcarcass4', ['label'] = 'Level 4 carcass', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingcarcass4.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to a certified hunter'}, 210 | ['huntingbait'] = {['name'] = 'huntingbait', ['label'] = 'Hunting Bait', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingbait.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A mixture of old meats and vegetables to attract animals'}, 211 | ['illegalcarcass1'] = {['name'] = 'illegalcarcass1', ['label'] = 'Level 1 poached carcass', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingcarcass1.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 212 | ['illegalcarcass2'] = {['name'] = 'illegalcarcass2', ['label'] = 'Level 2 poached carcass', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingcarcass2.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 213 | ['illegalcarcass3'] = {['name'] = 'illegalcarcass3', ['label'] = 'Level 3 poached carcass', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingcarcass3.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 214 | ['illegalcarcass4'] = {['name'] = 'illegalcarcass4', ['label'] = 'Level 4 poached carcass', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingcarcass4.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 215 | ['poachingbait'] = {['name'] = 'poachingbait', ['label'] = 'Poaching Bait', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingbait.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A mixture of old meats and vegetables to attract rare animals on a special island'}, 216 | ['bigfootfur'] = {['name'] = 'bigfootfur', ['label'] = 'Big Foot Fur', ['weight'] = 500, ['type'] = 'item', ['image'] = 'bigfootfur.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'The fur of an ancient, mythical animal'}, 217 | ['chimpcarcass1'] = {['name'] = 'chimpcarcass1', ['label'] = 'Level 1 poached chimp', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingcarcass1.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 218 | ['chimpcarcass2'] = {['name'] = 'chimpcarcass2', ['label'] = 'Level 2 poached chimp', ['weight'] = 115, ['type'] = 'item', ['image'] = 'huntingcarcass2.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 219 | ['chimpcarcass3'] = {['name'] = 'chimpcarcass3', ['label'] = 'Level 3 poached chimp', ['weight'] = 120, ['type'] = 'item', ['image'] = 'huntingcarcass3.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 220 | ['chimpcarcass4'] = {['name'] = 'chimpcarcass4', ['label'] = 'Level 4 poached chimp', ['weight'] = 125, ['type'] = 'item', ['image'] = 'huntingcarcass4.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 221 | ['deercarcass1'] = {['name'] = 'deercarcass1', ['label'] = 'Level 1 poached deer', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingcarcass1.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 222 | ['deercarcass2'] = {['name'] = 'deercarcass2', ['label'] = 'Level 2 poached deer', ['weight'] = 115, ['type'] = 'item', ['image'] = 'huntingcarcass2.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 223 | ['deercarcass3'] = {['name'] = 'deercarcass3', ['label'] = 'Level 3 poached deer', ['weight'] = 120, ['type'] = 'item', ['image'] = 'huntingcarcass3.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 224 | ['deercarcass4'] = {['name'] = 'deercarcass4', ['label'] = 'Level 4 poached deer', ['weight'] = 125, ['type'] = 'item', ['image'] = 'huntingcarcass4.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 225 | ['boarcarcass1'] = {['name'] = 'boarcarcass1', ['label'] = 'Level 1 boar', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingcarcass1.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 226 | ['boarcarcass2'] = {['name'] = 'boarcarcass2', ['label'] = 'Level 2 boar', ['weight'] = 115, ['type'] = 'item', ['image'] = 'huntingcarcass2.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 227 | ['boarcarcass3'] = {['name'] = 'boarcarcass3', ['label'] = 'Level 3 boar', ['weight'] = 120, ['type'] = 'item', ['image'] = 'huntingcarcass3.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 228 | ['boarcarcass4'] = {['name'] = 'boarcarcass4', ['label'] = 'Level 4 boar', ['weight'] = 125, ['type'] = 'item', ['image'] = 'huntingcarcass4.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 229 | ['wolfcarcass1'] = {['name'] = 'wolfcarcass1', ['label'] = 'Level 1 wolf', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingcarcass1.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 230 | ['wolfcarcass2'] = {['name'] = 'wolfcarcass2', ['label'] = 'Level 2 wolf', ['weight'] = 115, ['type'] = 'item', ['image'] = 'huntingcarcass2.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 231 | ['wolfcarcass3'] = {['name'] = 'wolfcarcass3', ['label'] = 'Level 3 wolf', ['weight'] = 120, ['type'] = 'item', ['image'] = 'huntingcarcass3.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 232 | ['wolfcarcass4'] = {['name'] = 'wolfcarcass4', ['label'] = 'Level 4 wolf', ['weight'] = 125, ['type'] = 'item', ['image'] = 'huntingcarcass4.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 233 | ['mtlioncarcass1'] = {['name'] = 'mtlioncarcass1', ['label'] = 'Level 1 mountain lion', ['weight'] = 100, ['type'] = 'item', ['image'] = 'huntingcarcass1.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to a certified hunter'}, 234 | ['mtlioncarcass2'] = {['name'] = 'mtlioncarcass2', ['label'] = 'Level 2 mountain lion', ['weight'] = 115, ['type'] = 'item', ['image'] = 'huntingcarcass2.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to a certified hunter'}, 235 | ['mtlioncarcass3'] = {['name'] = 'mtlioncarcass3', ['label'] = 'Level 3 mountainlion', ['weight'] = 125, ['type'] = 'item', ['image'] = 'huntingcarcass3.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to a certified hunter'}, 236 | ['mtlioncarcass4'] = {['name'] = 'mtlioncarcass4', ['label'] = 'Level 4 mountain lion', ['weight'] = 150, ['type'] = 'item', ['image'] = 'huntingcarcass4.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to a certified hunter'}, 237 | ['leather1'] = {['name'] = 'leather1', ['label'] = 'Level 2 Leather ', ['weight'] = 200, ['type'] = 'item', ['image'] = 'leather.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A sellable resource to an uncertified hunter'}, 238 | 239 | 240 | ```` 241 | add to qb-shops/config.lua (part1) 242 | ```` 243 | ["huntingstore"] = { 244 | [1] = { 245 | name = "weapon_knife", 246 | price = 150, 247 | amount = 5, 248 | info = {}, 249 | type = "item", 250 | slot = 1, 251 | requiresLicense = false 252 | }, 253 | [2] = { 254 | name = "weapon_huntingrifle", --replace with the gun that you wish to sell 255 | price = 1500, 256 | amount = 5, 257 | info = {}, 258 | type = "item", 259 | slot = 2, 260 | requiresLicense = true 261 | }, 262 | [3] = { 263 | name = "snp_ammo", --replace with the ammo that your gun uses 264 | price = 150, 265 | amount = 5, 266 | info = {}, 267 | type = "item", 268 | slot = 3, 269 | requiresLicense = true 270 | }, 271 | [4] = { 272 | name = "huntingbait", 273 | price = 25, 274 | amount = 50, 275 | info = {}, 276 | type = "item", 277 | slot = 4, 278 | requiresLicense = false 279 | }, 280 | }, 281 | ["poachingstore"] = { 282 | [1] = { 283 | name = "weapon_knife", 284 | price = 95, 285 | amount = 5, 286 | info = {}, 287 | type = "item", 288 | slot = 1, 289 | requiresLicense = false 290 | }, 291 | [2] = { 292 | name = "weapon_huntingrifle", 293 | price = 1100, 294 | amount = 5, 295 | info = {}, 296 | type = "item", 297 | slot = 2, 298 | requiresLicense = true 299 | }, 300 | [3] = { 301 | name = "snp_ammo", 302 | price = 125, 303 | amount = 5, 304 | info = {}, 305 | type = "item", 306 | slot = 3, 307 | requiresLicense = true 308 | }, 309 | [4] = { 310 | name = "poachingbait", 311 | price = 40, 312 | amount = 50, 313 | info = {}, 314 | type = "item", 315 | slot = 4, 316 | requiresLicense = false 317 | }, 318 | }, 319 | 320 | ```` 321 | add to qb-shops/config.lua (part2) 322 | ```` 323 | ["huntingstore"] = { 324 | ["label"] = "Hunting Store", 325 | ["type"] = "weapon", 326 | ["coords"] = { 327 | [1] = vector3(-774.45, 5603.32, 33.74) 328 | }, 329 | ["products"] = Config.Products["huntingstore"], 330 | ["showblip"] = true, 331 | }, 332 | ["poachingstore"] = { 333 | ["label"] = "Poaching Store", 334 | ["type"] = "weapon", 335 | ["coords"] = { 336 | [1] = vector3(186.12, -583.7, 43.87) 337 | }, 338 | ["products"] = Config.Products["poachingstore"], 339 | ["showblip"] = false, 340 | }, 341 | 342 | ```` 343 | add to qb-shops/client/main.lua (around lines 164 but can vary) (part3) 344 | ```` 345 | elseif Config.Locations[store]["products"] == Config.Products["huntingstore"] then 346 | SetBlipSprite(StoreBlip, 141) 347 | SetBlipScale(StoreBlip, 0.70) 348 | SetBlipColour(StoreBlip, 1) 349 | ```` 350 | lastly put the item images into your qb-inventory/html/images 351 | 352 | common problems 353 | 354 | why can i not see the shop when i use target? 355 | 356 | you need to make sure that you have the item weaponlicense in your inventory 357 | 358 | why can i not see the gun or ammo in the store is it broken? 359 | 360 | no, you need to set your job as police and give yourself a weapons license using 361 | /grantlicense weapon 362 | 363 | or in qb-shops where it says 364 | 365 | [2] = { 366 | name = "weapon_huntingrifle", 367 | price = 1500, 368 | amount = 5, 369 | info = {}, 370 | type = "item", 371 | slot = 2, 372 | requiresLicense = true --you just switch this to false meaning everybody will have access to it 373 | }, 374 | -------------------------------------------------------------------------------- /client/cl_main.lua: -------------------------------------------------------------------------------- 1 | QBCore = exports['qb-core']:GetCoreObject() 2 | 3 | local cooldown = 0 4 | local used = false 5 | local jobSpawned = false 6 | local refreshPed = false 7 | local jobPed 8 | local useBaitCooldown = 3 9 | local illegalhunting = false 10 | local hunting1 = false 11 | local hunting2 = false 12 | 13 | local HuntingZones = { 14 | 'MTCHIL', 15 | 'CANNY', 16 | 'MTGORDO', 17 | 'CMSW', 18 | 'MTJOSE', 19 | } 20 | 21 | local HuntingAnimals = { 22 | 'a_c_boar', 23 | 'a_c_deer', 24 | 'a_c_coyote', 25 | 'a_c_mtlion', 26 | '' 27 | } 28 | 29 | local PoachingAnimals = { 30 | 'a_c_husky', 31 | 'cs_orleans', 32 | 'a_c_husky', 33 | 'a_c_chimp', 34 | 'a_c_rhesus' 35 | } 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | local hunting1 = PolyZone:Create({ 44 | vector2(-1038.8045654296, 4901.2412109375), 45 | vector2(-1091.1923828125, 4859.3642578125), 46 | vector2(-1091.1215820312, 4825.0385742188), 47 | vector2(-1025.4008789062, 4753.3022460938), 48 | vector2(-1034.3443603516, 4710.3374023438), 49 | vector2(-927.85998535156, 4542.5517578125), 50 | vector2(-818.37982177734, 4578.015625), 51 | vector2(-780.34484863282, 4629.5361328125), 52 | vector2(-651.40478515625, 4868.2495117188), 53 | vector2(-674.4242553711, 4893.9375), 54 | vector2(-712.4755859375, 4913.44921875), 55 | vector2(-646.5297241211, 4971.1142578125), 56 | vector2(-624.30767822266, 4987.6918945312), 57 | vector2(-635.17657470704, 5042.0034179688), 58 | vector2(-653.0980834961, 5062.4765625), 59 | vector2(-684.53759765625, 5068.2963867188), 60 | vector2(-762.43658447266, 5047.5288085938), 61 | vector2(-786.80352783204, 5056.8403320312), 62 | vector2(-763.65802001954, 5086.0029296875), 63 | vector2(-771.650390625, 5103.3525390625), 64 | vector2(-815.06158447266, 5111.755859375), 65 | vector2(-852.68292236328, 5124.4345703125), 66 | vector2(-883.73260498046, 5069.4873046875), 67 | vector2(-953.28503417968, 5001.0512695312), 68 | vector2(-960.19384765625, 4968.0444335938) 69 | }, { 70 | debugPoly = false, 71 | name="hunting1", 72 | minZ = 143.82234191894, 73 | maxZ = 294.69619750976 74 | 75 | }) 76 | 77 | hunting1:onPlayerInOut(function(isPointInside) 78 | if isPointInside then 79 | inhunting1 = true 80 | exports['t-notify']:Alert({ 81 | style = 'info', 82 | message = 'Entered Hunting Area' 83 | }) 84 | --[[ exports['qb-target']:AddTargetEntity(HuntingAnimals, { 85 | options = { 86 | { 87 | --item = 'weapon-knife', 88 | event = "Leux-hunting:skinAnimal", 89 | icon = "far fa-hand-paper", 90 | label = "Skin", 91 | }, 92 | }, 93 | distance = 3.0 94 | })]] 95 | 96 | else 97 | inhunting1 = false 98 | exports['t-notify']:Alert({ 99 | style = 'info', 100 | message = 'Exited Hunting Area' 101 | }) 102 | --[[ exports['qb-target']:RemoveTargetEntity(HuntingAnimals, { 103 | options = { 104 | { 105 | event = "Leux-hunting:skinAnimal", 106 | icon = "far fa-hand-paper", 107 | label = "Skin", 108 | }, 109 | }, 110 | distance = 3.0 111 | })]] 112 | end 113 | end) 114 | 115 | 116 | local hunting2 = PolyZone:Create({ 117 | vector2(5031.46, -4992.36), 118 | vector2(5117.32, -4965.71), 119 | vector2(5093.46, -4957.36), 120 | vector2(5076.55, -4948.27), 121 | vector2(5021.01, -4936.49), 122 | vector2(4963.61, -4948.76), 123 | vector2(4920.51, -4518.03), 124 | vector2(4574.47, -4495.4), 125 | vector2(4543.8, -4565.8), 126 | vector2(4524.2, -4597.74), 127 | vector2(4561.02, -4687.65), 128 | vector2(4696.17, -4640.88), 129 | vector2(4847.11, -4764.49), 130 | vector2(4891.55, -4754.8), 131 | vector2(4915.35, -4929.2), 132 | vector2(4841.45, -4853.53), 133 | vector2(4845.63, -4887.64), 134 | vector2(4928.14, -4859.69), 135 | vector2(4940.02, -4825.91) 136 | }, { 137 | debugPoly = true, 138 | name="hunting2", 139 | minZ = -20.82234191894, 140 | maxZ = 150.83 141 | 142 | }) 143 | 144 | hunting2:onPlayerInOut(function(isPointInside) 145 | if isPointInside then 146 | inhunting2 = true 147 | exports['t-notify']:Alert({ 148 | style = 'info', 149 | message = 'Entered Illegal Hunting Area' 150 | }) 151 | --[[ exports['qb-target']:AddTargetEntity(PoachingAnimals, { 152 | options = { 153 | { 154 | --item = 'weapon-knife', 155 | event = "Leux-hunting:skinpoachedAnimal", 156 | icon = "far fa-hand-paper", 157 | label = "Skin", 158 | }, 159 | }, 160 | distance = 3.0 161 | })]] 162 | 163 | else 164 | inhunting2 = false 165 | exports['t-notify']:Alert({ 166 | style = 'info', 167 | message = 'Exited Illegal Hunting Area' 168 | }) 169 | --[[ exports['qb-target']:RemoveTargetEntity(PoachingAnimals, { 170 | options = { 171 | { 172 | event = "Leux-hunting:skinpoachedAnimal", 173 | icon = "far fa-hand-paper", 174 | label = "Skin", 175 | }, 176 | }, 177 | distance = 3.0 178 | })]] 179 | end 180 | end) 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | local dumbass = vector3(-772.96, 5597.13, 33.61) 203 | 204 | Citizen.CreateThread(function() 205 | blip = AddBlipForCoord(-679.89,5838.79,16.33) 206 | SetBlipSprite(blip, 141) 207 | SetBlipDisplay(blip, 4) 208 | SetBlipScale(blip, 0.8) 209 | SetBlipColour(blip, 1) 210 | SetBlipAsShortRange(blip, true) 211 | BeginTextCommandSetBlipName("STRING") 212 | AddTextComponentString("Hunting Shop") 213 | EndTextCommandSetBlipName(blip) 214 | 215 | local legalHunts = { 216 | `a_c_boar`, 217 | `a_c_deer`, 218 | `a_c_coyote`, 219 | `a_c_mtlion`, 220 | } 221 | 222 | local chimpanzee = { 223 | `a_c_chimp`, 224 | `a_c_rhesus`, 225 | } 226 | 227 | local deer = { 228 | `a_c_deer`, 229 | } 230 | 231 | local boar = { 232 | `a_c_boar`, 233 | } 234 | 235 | local wolf = { 236 | `a_c_coyote`, 237 | } 238 | 239 | local husky = { 240 | `a_c_husky`, 241 | } 242 | 243 | local bigfoot = { 244 | `cs_orleans`, 245 | } 246 | local poachinglegalHunts = { 247 | `a_c_husky`, 248 | `a_c_chimp`, 249 | `a_c_rhesus`, 250 | } 251 | 252 | local illlegalHunts = { 253 | `a_c_chop`, 254 | `a_c_husky`, 255 | `a_c_retriever`, 256 | `a_c_westy`, 257 | `a_c_shepherd`, 258 | `a_c_poodle`, 259 | `u_m_y_gunvend_01`, 260 | } 261 | 262 | exports['qb-target']:AddTargetModel(legalHunts, { 263 | options = { 264 | { 265 | item = 'weapon_knife', 266 | event = "Leux-hunting:skinAnimal", 267 | icon = "far fa-hand-paper", 268 | label = "Skin", 269 | canInteract = function() 270 | if inhunting1 then 271 | return true 272 | else 273 | return false 274 | end 275 | end, 276 | }, 277 | }, 278 | job = {"all"}, 279 | distance = 6.5 280 | }) 281 | 282 | --exports['qb-target']:AddTargetModel(poachinglegalHunts, { 283 | -- options = { 284 | -- { 285 | -- item = 'weapon_knife', 286 | -- event = "Leux-hunting:skinpoachedAnimal", 287 | -- icon = "far fa-hand-paper", 288 | -- label = "Skin", 289 | -- canInteract = function() 290 | -- if inhunting2 then 291 | -- return true 292 | -- else 293 | -- return false 294 | -- end 295 | -- end, 296 | -- }, 297 | -- }, 298 | -- job = {"all"}, 299 | -- distance = 6.5 300 | -- }) 301 | 302 | exports['qb-target']:AddTargetModel(deer, { 303 | options = { 304 | { 305 | item = 'weapon_knife', 306 | event = "Leux-hunting:skinpoachedchimpanzeeAnimal", 307 | icon = "far fa-hand-paper", 308 | label = "Skin Chimpanzee", 309 | canInteract = function() 310 | if inhunting2 then 311 | return true 312 | else 313 | return false 314 | end 315 | end, 316 | }, 317 | }, 318 | job = {"all"}, 319 | distance = 6.5 320 | }) 321 | 322 | exports['qb-target']:AddTargetModel(chimpanzee, { 323 | options = { 324 | { 325 | item = 'weapon_knife', 326 | event = "Leux-hunting:deerAnimal", 327 | icon = "far fa-hand-paper", 328 | label = "Skin Chimp", 329 | canInteract = function() 330 | if inhunting1 then 331 | return true 332 | else 333 | return false 334 | end 335 | end, 336 | }, 337 | }, 338 | job = {"all"}, 339 | distance = 6.5 340 | }) 341 | 342 | exports['qb-target']:AddTargetModel(boar, { 343 | options = { 344 | { 345 | item = 'weapon_knife', 346 | event = "Leux-hunting:boarAnimal", 347 | icon = "far fa-hand-paper", 348 | label = "Skin Boar", 349 | canInteract = function() 350 | if inhunting1 then 351 | return true 352 | else 353 | return false 354 | end 355 | end, 356 | }, 357 | }, 358 | job = {"all"}, 359 | distance = 6.5 360 | }) 361 | 362 | exports['qb-target']:AddTargetModel(wolf, { 363 | options = { 364 | { 365 | item = 'weapon_knife', 366 | event = "Leux-hunting:wolfAnimal", 367 | icon = "far fa-hand-paper", 368 | label = "Skin Coyote", 369 | canInteract = function() 370 | if inhunting1 then 371 | return true 372 | else 373 | return false 374 | end 375 | end, 376 | }, 377 | }, 378 | job = {"all"}, 379 | distance = 6.5 380 | }) 381 | 382 | exports['qb-target']:AddTargetModel(husky, { 383 | options = { 384 | { 385 | item = 'weapon_knife', 386 | event = "Leux-hunting:wolfAnimal", 387 | icon = "far fa-hand-paper", 388 | label = "Skin Husky", 389 | canInteract = function() 390 | if inhunting2 then 391 | return true 392 | else 393 | return false 394 | end 395 | end, 396 | }, 397 | }, 398 | job = {"all"}, 399 | distance = 6.5 400 | }) 401 | 402 | exports['qb-target']:AddTargetModel(bigfoot, { 403 | options = { 404 | { 405 | item = 'weapon_knife', 406 | event = "Leux-hunting:skinbigfoot", 407 | icon = "far fa-hand-paper", 408 | label = "Skin Bigfoot", 409 | canInteract = function() 410 | if inhunting2 then 411 | return true 412 | else 413 | return false 414 | end 415 | end, 416 | }, 417 | }, 418 | job = {"all"}, 419 | distance = 6.5 420 | }) 421 | 422 | 423 | --//ARP\\-- To be finished for events 424 | --if Config.EnablePoaching then 425 | -- if illegalhunting then 426 | -- exports['qb-targer']:AddTargetModel(illlegalHunts, { 427 | -- options = { 428 | -- { 429 | -- event = "Leux-hunting:skinAnimalIllegal", 430 | -- icon = "far fa-hand-paper", 431 | -- label = "Skin", 432 | -- }, 433 | -- }, 434 | -- job = {"all"}, 435 | -- distance = 1.5 436 | -- }) 437 | -- end 438 | --//ARP\\-- To be finished for events 439 | 440 | --if Config.EnablePoaching1 then 441 | -- if illegalhunting then 442 | -- exports['qb-targer']:AddTargetModel(illlegalHunts, { 443 | -- options = { 444 | -- { 445 | -- event = "Leux-hunting:skinAnimalIllegal", 446 | -- icon = "far fa-hand-paper", 447 | -- label = "Skin", 448 | -- }, 449 | -- }, 450 | -- job = {"all"}, 451 | -- distance = 1.5 452 | -- }) 453 | -- end 454 | 455 | SetScenarioTypeEnabled('WORLD_DEER_GRAZING',false) 456 | SetScenarioTypeEnabled('WORLD_COYOTE_WANDER',false) 457 | SetScenarioTypeEnabled('WORLD_COYOTE_REST',false) 458 | --SetScenarioTypeEnabled('WORLD_RABBIT_EATING',false) 459 | SetScenarioTypeEnabled('WORLD_BOAR_GRAZING',false) 460 | SetScenarioTypeEnabled('WORLD_MOUNTAIN_LION_WANDER',false) 461 | SetScenarioTypeEnabled('WORLD_MOUNTAIN_LION_REST',false) 462 | end) 463 | 464 | -- Citizen.CreateThread(function() 465 | -- while true do 466 | -- Wait(1000) 467 | -- if refreshPed then 468 | -- if DoesEntityExist(jobPed) then 469 | -- exports['qb-target']:AddEntityZone('huntPed', jobPed, { 470 | -- name="huntPed", 471 | -- debugPoly=false, 472 | -- useZ = true 473 | -- }, { 474 | -- options = { 475 | -- { 476 | -- event = "Leux-hunting:general", 477 | -- icon = "fab fa-shopify", 478 | -- label = "Hunting Shop", 479 | -- }, 480 | -- }, 481 | -- job = {"all"}, 482 | -- distance = 1.5 483 | -- }) 484 | -- refreshPed = false 485 | -- end 486 | -- end 487 | -- end 488 | -- end) 489 | 490 | --[[Citizen.CreateThread(function() 491 | while true do 492 | Citizen.Wait(1000) 493 | local pedCoords = GetEntityCoords(PlayerPedId()) 494 | local dst = #(dumbass - pedCoords) 495 | --print(dst) 496 | if dst < 40 and jobSpawned == false then 497 | TriggerEvent('Leux-hunting:spawnJobPed',dumbass, 225.87) 498 | jobSpawned = true 499 | refreshPed = true 500 | end 501 | if dst >= 41 then 502 | if DoesEntityExist(jobPed) then 503 | DeletePed(jobPed) 504 | end 505 | jobSpawned = false 506 | end 507 | end 508 | end)--]] 509 | 510 | --[[RegisterNetEvent('Leux-hunting:spawnJobPed') 511 | AddEventHandler('Leux-hunting:spawnJobPed',function(coords, heading) 512 | local hash = GetHashKey('ig_hunter') 513 | if not HasModelLoaded(hash) then 514 | RequestModel(hash) 515 | Wait(10) 516 | end 517 | while not HasModelLoaded(hash) do 518 | Wait(10) 519 | end 520 | jobPed = CreatePed(5, hash, coords, heading, false, false) 521 | FreezeEntityPosition(jobPed, true) 522 | SetEntityInvincible(jobPed, true) 523 | SetBlockingOfNonTemporaryEvents(jobPed, true) 524 | SetModelAsNoLongerNeeded(hash) 525 | end)--]] 526 | 527 | 528 | RegisterNetEvent('Leux-hunting:spawnAnimal') 529 | AddEventHandler('Leux-hunting:spawnAnimal', function() 530 | local ped = PlayerPedId() 531 | local coords = GetEntityCoords(ped) 532 | local radius = 50.0 533 | local x = coords.x + math.random(-radius,radius) 534 | local y = coords.y + math.random(-radius,radius) 535 | local safeCoord, outPosition = GetSafeCoordForPed(x,y,coords.z,false,16) 536 | --animal = Config.HuntingAnimals[math.random(#Config.HuntingAnimals)] --HuntingAnimals 537 | animal = HuntingAnimals[math.random(#HuntingAnimals)] 538 | local hash = GetHashKey(animal) 539 | if not HasModelLoaded(hash) then 540 | RequestModel(hash) 541 | Wait(10) 542 | end 543 | while not HasModelLoaded(hash) do 544 | Wait(10) 545 | end 546 | if outPosition.x > 1 or outPosition.x < -1 then 547 | --Wait(2000) 548 | Wait(8000) 549 | baitAnimal = CreatePed(28, hash, outPosition.x, outPosition.y, outPosition.z, 0, true, false) 550 | else 551 | QBCore.Functions.Notify("You are too far away from the bait", "error") 552 | end 553 | if DoesEntityExist(baitAnimal) then 554 | TaskGoToCoordAnyMeans(baitAnimal,coords,2.0,0,786603,0) 555 | end 556 | end) 557 | 558 | Citizen.CreateThread(function() 559 | while true do 560 | Wait(1000) 561 | if DoesEntityExist(baitAnimal) then 562 | local ped = PlayerPedId() 563 | local coords = GetEntityCoords(PlayerPedId()) 564 | local animalCoords = GetEntityCoords(baitAnimal) 565 | local dst = #(coords - animalCoords) 566 | HideHudComponentThisFrame(14) 567 | if dst < 2.5 then -- spook animal 568 | TaskCombatPed(baitAnimal,ped,0,16) 569 | end 570 | end 571 | end 572 | end) 573 | 574 | RegisterNetEvent('Leux-hunting:skinAnimal') 575 | AddEventHandler('Leux-hunting:skinAnimal', function() 576 | local weapon = GetSelectedPedWeapon(PlayerPedId()) 577 | if DoesEntityExist(baitAnimal) then 578 | if QBCore.Shared.Weapons[weapon]["name"] ~= "weapon_unarmed" and not QBCore.Shared.Weapons["weapon_huntingrifle"] then 579 | LoadAnimDict('amb@medic@standing@kneel@base') 580 | LoadAnimDict('anim@gangops@facility@servers@bodysearch@') 581 | TaskPlayAnim(PlayerPedId(), "amb@medic@standing@kneel@base" ,"base" ,8.0, -8.0, -1, 1, 0, false, false, false ) 582 | TaskPlayAnim(PlayerPedId(), "anim@gangops@facility@servers@bodysearch@" ,"player_search" ,8.0, -8.0, -1, 48, 0, false, false, false ) 583 | QBCore.Functions.Progressbar("eat_something", "Skinning..", 5000) 584 | Citizen.Wait(5000) 585 | TriggerEvent('animations:client:EmoteCommandStart', {"medic"}) 586 | local seconds = math.random(10,35) 587 | local circles = 1 588 | local success = exports['qb-lock']:StartLockPickCircle(circles, seconds, success) 589 | if success then 590 | local seconds1 = math.random(10,35) 591 | local circles1 = 1 592 | local success1 = exports['qb-lock']:StartLockPickCircle(circles1, seconds1, success1) 593 | if success1 then 594 | local seconds2 = math.random(10,35) 595 | local circles2 = 1 596 | local success2 = exports['qb-lock']:StartLockPickCircle(circles2, seconds2, success2) 597 | if success2 then 598 | ClearPedTasksImmediately(PlayerPedId()) 599 | DeleteEntity(baitAnimal) 600 | TriggerServerEvent('Leux-hunting:skinReward') 601 | end 602 | end 603 | end 604 | else 605 | QBCore.Functions.Notify("You need a knife", "error") 606 | end 607 | else 608 | QBCore.Functions.Notify("You have already skinned 1 animal for the bait or this is another hunters animal", "error") 609 | end 610 | end) 611 | 612 | RegisterNetEvent('Leux-hunting:usedBait') 613 | AddEventHandler('Leux-hunting:usedBait', function() 614 | --for k,v in pairs (HuntingZones) do 615 | if inhunting1 then 616 | if cooldown <= 0 then 617 | LoadAnimDict('amb@medic@standing@kneel@base') 618 | TaskPlayAnim(PlayerPedId(), "amb@medic@standing@kneel@base" ,"base" ,8.0, -8.0, -1, 1, 0, false, false, false ) 619 | QBCore.Functions.Progressbar("eat_something", "Setting Bait..", 5000) 620 | Citizen.Wait(5000) 621 | TriggerEvent('animations:client:EmoteCommandStart', {"medic"}) 622 | local seconds = math.random(10,35) 623 | local circles = 1 624 | local success = exports['qb-lock']:StartLockPickCircle(circles, seconds, success) 625 | if success then 626 | local seconds1 = math.random(10,35) 627 | local circles1 = 1 628 | local success1 = exports['qb-lock']:StartLockPickCircle(circles1, seconds1, success1) 629 | if success1 then 630 | local seconds2 = math.random(10,35) 631 | local circles2 = 1 632 | local success2 = exports['qb-lock']:StartLockPickCircle(circles2, seconds2, success2) 633 | if success2 then 634 | Citizen.Wait(100) 635 | ClearPedTasksImmediately(PlayerPedId()) 636 | used = true 637 | usedBait() 638 | TriggerEvent('Leux-hunting:spawnAnimal') 639 | TriggerServerEvent('Leux-hunting:removeBait') 640 | TriggerEvent("QBCore:Notify", "Success, move away and wait for the animal to arrive", "success") 641 | end 642 | end 643 | end 644 | end 645 | else 646 | QBCore.Functions.Notify("You Are Not In a Hunting Zone", "error") 647 | end 648 | end) 649 | 650 | function baitCooldown() 651 | Citizen.CreateThread(function() 652 | while cooldown > 0 do 653 | Wait(2000) 654 | cooldown = cooldown - 1000 655 | end 656 | end) 657 | end 658 | 659 | function usedBait() 660 | Citizen.CreateThread(function() 661 | while used do 662 | print('waiting to spawn') 663 | Wait(1500) 664 | print('spawning') 665 | TriggerEvent('Leux-hunting:spawnAnimal') 666 | used = false 667 | end 668 | end) 669 | end 670 | 671 | function playerAnim() 672 | LoadAnimDict( "mp_safehouselost@" ) 673 | TaskPlayAnim( PlayerPedId(), "mp_safehouselost@", "package_dropoff", 8.0, 1.0, -1, 16, 0, 0, 0, 0 ) 674 | end 675 | 676 | function LoadAnimDict(dict) 677 | while (not HasAnimDictLoaded(dict)) do 678 | RequestAnimDict(dict) 679 | Citizen.Wait(10) 680 | end 681 | end 682 | 683 | 684 | --poaching 685 | 686 | function usedillegalBait() 687 | Citizen.CreateThread(function() 688 | while used do 689 | print('waiting to spawn') 690 | Wait(1500) 691 | print('spawning') 692 | TriggerEvent('Leux-hunting:spawnpoaching') 693 | used = false 694 | end 695 | end) 696 | end 697 | 698 | RegisterNetEvent('Leux-hunting:spawnpoaching') 699 | AddEventHandler('Leux-hunting:spawnpoaching', function() 700 | local ped = PlayerPedId() 701 | local coords = GetEntityCoords(ped) 702 | local radius = 50.0 703 | local x = coords.x + math.random(-radius,radius) 704 | local y = coords.y + math.random(-radius,radius) 705 | local safeCoord, outPosition = GetSafeCoordForPed(x,y,coords.z,false,16) 706 | --animal1 = Config.PoachingAnimals[math.random(#Config.PoachingAnimals)] --HuntingAnimals 707 | animal1 = PoachingAnimals[math.random(#PoachingAnimals)] 708 | local hash = GetHashKey(animal1) 709 | if not HasModelLoaded(hash) then 710 | RequestModel(hash) 711 | Wait(10) 712 | end 713 | while not HasModelLoaded(hash) do 714 | Wait(10) 715 | end 716 | if outPosition.x > 1 or outPosition.x < -1 then 717 | --Wait(2000) 718 | Wait(8000) 719 | baitAnimal = CreatePed(28, hash, outPosition.x, outPosition.y, outPosition.z, 0, true, false) 720 | else 721 | QBCore.Functions.Notify("You are too far away from the bait", "error") 722 | end 723 | if DoesEntityExist(baitAnimal) then 724 | TaskGoToCoordAnyMeans(baitAnimal,coords,2.0,0,786603,0) 725 | end 726 | end) 727 | 728 | RegisterNetEvent('Leux-hunting:usedPoaching') 729 | AddEventHandler('Leux-hunting:usedPoaching', function() 730 | --for k,v in pairs (HuntingZones) do 731 | if inhunting2 then 732 | if cooldown <= 0 then 733 | LoadAnimDict('amb@medic@standing@kneel@base') 734 | TaskPlayAnim(PlayerPedId(), "amb@medic@standing@kneel@base" ,"base" ,8.0, -8.0, -1, 1, 0, false, false, false ) 735 | QBCore.Functions.Progressbar("eat_something", "Setting Bait..", 5000) 736 | Citizen.Wait(5000) 737 | TriggerEvent('animations:client:EmoteCommandStart', {"medic"}) 738 | local seconds = math.random(10,35) 739 | local circles = 1 740 | local success = exports['qb-lock']:StartLockPickCircle(circles, seconds, success) 741 | if success then 742 | local seconds1 = math.random(10,35) 743 | local circles1 = 1 744 | local success1 = exports['qb-lock']:StartLockPickCircle(circles1, seconds1, success1) 745 | if success1 then 746 | local seconds2 = math.random(10,35) 747 | local circles2 = 1 748 | local success2 = exports['qb-lock']:StartLockPickCircle(circles2, seconds2, success2) 749 | if success2 then 750 | Citizen.Wait(100) 751 | ClearPedTasksImmediately(PlayerPedId()) 752 | used = true 753 | usedillegalBait() 754 | TriggerEvent('Leux-hunting:spawnpoaching') 755 | TriggerServerEvent('Leux-hunting:removepoachingBait') 756 | TriggerEvent("QBCore:Notify", "Success, move away and wait for the animal to arrive", "success") 757 | end 758 | end 759 | end 760 | end 761 | else 762 | QBCore.Functions.Notify("You Are Not In a Poaching Zone", "error") 763 | end 764 | end) 765 | 766 | RegisterNetEvent('Leux-hunting:skinpoachedAnimal') 767 | AddEventHandler('Leux-hunting:skinpoachedAnimal', function() 768 | local weapon = GetSelectedPedWeapon(PlayerPedId()) 769 | if DoesEntityExist(baitAnimal) then 770 | if QBCore.Shared.Weapons[weapon]["name"] ~= "weapon_unarmed" and not QBCore.Shared.Weapons["weapon_huntingrifle"] then 771 | LoadAnimDict('amb@medic@standing@kneel@base') 772 | LoadAnimDict('anim@gangops@facility@servers@bodysearch@') 773 | TaskPlayAnim(PlayerPedId(), "amb@medic@standing@kneel@base" ,"base" ,8.0, -8.0, -1, 1, 0, false, false, false ) 774 | TaskPlayAnim(PlayerPedId(), "anim@gangops@facility@servers@bodysearch@" ,"player_search" ,8.0, -8.0, -1, 48, 0, false, false, false ) 775 | QBCore.Functions.Progressbar("eat_something", "Skinning..", 5000) 776 | Citizen.Wait(5000) 777 | TriggerEvent('animations:client:EmoteCommandStart', {"medic"}) 778 | local seconds = math.random(10,35) 779 | local circles = 1 780 | local success = exports['qb-lock']:StartLockPickCircle(circles, seconds, success) 781 | if success then 782 | local seconds1 = math.random(10,35) 783 | local circles1 = 1 784 | local success1 = exports['qb-lock']:StartLockPickCircle(circles1, seconds1, success1) 785 | if success1 then 786 | local seconds2 = math.random(10,35) 787 | local circles2 = 1 788 | local success2 = exports['qb-lock']:StartLockPickCircle(circles2, seconds2, success2) 789 | if success2 then 790 | ClearPedTasksImmediately(PlayerPedId()) 791 | DeleteEntity(baitAnimal) 792 | TriggerServerEvent('Leux-hunting:poachingReward') 793 | end 794 | end 795 | end 796 | else 797 | QBCore.Functions.Notify("You need a knife", "error") 798 | end 799 | else 800 | QBCore.Functions.Notify("You have already skinned 1 animal for the bait or this is another hunters animal", "error") 801 | end 802 | end) 803 | 804 | RegisterNetEvent('Leux-hunting:skinpoachedchimpanzeeAnimal') 805 | AddEventHandler('Leux-hunting:skinpoachedchimpanzeeAnimal', function() 806 | local weapon = GetSelectedPedWeapon(PlayerPedId()) 807 | if DoesEntityExist(baitAnimal) then 808 | if QBCore.Shared.Weapons[weapon]["name"] ~= "weapon_unarmed" and not QBCore.Shared.Weapons["weapon_huntingrifle"] then 809 | LoadAnimDict('amb@medic@standing@kneel@base') 810 | LoadAnimDict('anim@gangops@facility@servers@bodysearch@') 811 | TaskPlayAnim(PlayerPedId(), "amb@medic@standing@kneel@base" ,"base" ,8.0, -8.0, -1, 1, 0, false, false, false ) 812 | TaskPlayAnim(PlayerPedId(), "anim@gangops@facility@servers@bodysearch@" ,"player_search" ,8.0, -8.0, -1, 48, 0, false, false, false ) 813 | QBCore.Functions.Progressbar("eat_something", "Skinning Chimpanzee..", 5000) 814 | Citizen.Wait(5000) 815 | TriggerEvent('animations:client:EmoteCommandStart', {"medic"}) 816 | local seconds = math.random(10,35) 817 | local circles = 1 818 | local success = exports['qb-lock']:StartLockPickCircle(circles, seconds, success) 819 | if success then 820 | local seconds1 = math.random(10,35) 821 | local circles1 = 1 822 | local success1 = exports['qb-lock']:StartLockPickCircle(circles1, seconds1, success1) 823 | if success1 then 824 | local seconds2 = math.random(10,35) 825 | local circles2 = 1 826 | local success2 = exports['qb-lock']:StartLockPickCircle(circles2, seconds2, success2) 827 | if success2 then 828 | ClearPedTasksImmediately(PlayerPedId()) 829 | DeleteEntity(baitAnimal) 830 | TriggerServerEvent('Leux-hunting:poachingchimpReward') 831 | end 832 | end 833 | end 834 | else 835 | QBCore.Functions.Notify("You need a knife", "error") 836 | end 837 | else 838 | QBCore.Functions.Notify("You have already skinned 1 animal for the bait or this is another hunters animal", "error") 839 | end 840 | end) 841 | 842 | RegisterNetEvent('Leux-hunting:deerAnimal') 843 | AddEventHandler('Leux-hunting:deerAnimal', function() 844 | local weapon = GetSelectedPedWeapon(PlayerPedId()) 845 | if DoesEntityExist(baitAnimal) then 846 | if QBCore.Shared.Weapons[weapon]["name"] ~= "weapon_unarmed" and not QBCore.Shared.Weapons["weapon_huntingrifle"] then 847 | LoadAnimDict('amb@medic@standing@kneel@base') 848 | LoadAnimDict('anim@gangops@facility@servers@bodysearch@') 849 | TaskPlayAnim(PlayerPedId(), "amb@medic@standing@kneel@base" ,"base" ,8.0, -8.0, -1, 1, 0, false, false, false ) 850 | TaskPlayAnim(PlayerPedId(), "anim@gangops@facility@servers@bodysearch@" ,"player_search" ,8.0, -8.0, -1, 48, 0, false, false, false ) 851 | QBCore.Functions.Progressbar("eat_something", "Skinning Deer..", 5000) 852 | Citizen.Wait(5000) 853 | TriggerEvent('animations:client:EmoteCommandStart', {"medic"}) 854 | local seconds = math.random(10,35) 855 | local circles = 1 856 | local success = exports['qb-lock']:StartLockPickCircle(circles, seconds, success) 857 | if success then 858 | local seconds1 = math.random(10,35) 859 | local circles1 = 1 860 | local success1 = exports['qb-lock']:StartLockPickCircle(circles1, seconds1, success1) 861 | if success1 then 862 | local seconds2 = math.random(10,35) 863 | local circles2 = 1 864 | local success2 = exports['qb-lock']:StartLockPickCircle(circles2, seconds2, success2) 865 | if success2 then 866 | ClearPedTasksImmediately(PlayerPedId()) 867 | DeleteEntity(baitAnimal) 868 | TriggerServerEvent('Leux-hunting:deerReward') 869 | end 870 | end 871 | end 872 | else 873 | QBCore.Functions.Notify("You need a knife", "error") 874 | end 875 | else 876 | QBCore.Functions.Notify("You have already skinned 1 animal for the bait or this is another hunters animal", "error") 877 | end 878 | end) 879 | 880 | RegisterNetEvent('Leux-hunting:boarAnimal') 881 | AddEventHandler('Leux-hunting:boarAnimal', function() 882 | local weapon = GetSelectedPedWeapon(PlayerPedId()) 883 | if DoesEntityExist(baitAnimal) then 884 | if QBCore.Shared.Weapons[weapon]["name"] ~= "weapon_unarmed" and not QBCore.Shared.Weapons["weapon_huntingrifle"] then 885 | LoadAnimDict('amb@medic@standing@kneel@base') 886 | LoadAnimDict('anim@gangops@facility@servers@bodysearch@') 887 | TaskPlayAnim(PlayerPedId(), "amb@medic@standing@kneel@base" ,"base" ,8.0, -8.0, -1, 1, 0, false, false, false ) 888 | TaskPlayAnim(PlayerPedId(), "anim@gangops@facility@servers@bodysearch@" ,"player_search" ,8.0, -8.0, -1, 48, 0, false, false, false ) 889 | QBCore.Functions.Progressbar("eat_something", "Skinning Boar..", 5000) 890 | Citizen.Wait(5000) 891 | TriggerEvent('animations:client:EmoteCommandStart', {"medic"}) 892 | local seconds = math.random(10,35) 893 | local circles = 1 894 | local success = exports['qb-lock']:StartLockPickCircle(circles, seconds, success) 895 | if success then 896 | local seconds1 = math.random(10,35) 897 | local circles1 = 1 898 | local success1 = exports['qb-lock']:StartLockPickCircle(circles1, seconds1, success1) 899 | if success1 then 900 | local seconds2 = math.random(10,35) 901 | local circles2 = 1 902 | local success2 = exports['qb-lock']:StartLockPickCircle(circles2, seconds2, success2) 903 | if success2 then 904 | ClearPedTasksImmediately(PlayerPedId()) 905 | DeleteEntity(baitAnimal) 906 | TriggerServerEvent('Leux-hunting:boarReward') 907 | end 908 | end 909 | end 910 | else 911 | QBCore.Functions.Notify("You need a knife", "error") 912 | end 913 | else 914 | QBCore.Functions.Notify("You have already skinned 1 animal for the bait or this is another hunters animal", "error") 915 | end 916 | end) 917 | 918 | RegisterNetEvent('Leux-hunting:wolfAnimal') 919 | AddEventHandler('Leux-hunting:wolfAnimal', function() 920 | local weapon = GetSelectedPedWeapon(PlayerPedId()) 921 | if DoesEntityExist(baitAnimal) then 922 | if QBCore.Shared.Weapons[weapon]["name"] ~= "weapon_unarmed" and not QBCore.Shared.Weapons["weapon_huntingrifle"] then 923 | LoadAnimDict('amb@medic@standing@kneel@base') 924 | LoadAnimDict('anim@gangops@facility@servers@bodysearch@') 925 | TaskPlayAnim(PlayerPedId(), "amb@medic@standing@kneel@base" ,"base" ,8.0, -8.0, -1, 1, 0, false, false, false ) 926 | TaskPlayAnim(PlayerPedId(), "anim@gangops@facility@servers@bodysearch@" ,"player_search" ,8.0, -8.0, -1, 48, 0, false, false, false ) 927 | QBCore.Functions.Progressbar("eat_something", "Skinning Wolf..", 5000) 928 | Citizen.Wait(5000) 929 | TriggerEvent('animations:client:EmoteCommandStart', {"medic"}) 930 | local seconds = math.random(10,35) 931 | local circles = 1 932 | local success = exports['qb-lock']:StartLockPickCircle(circles, seconds, success) 933 | if success then 934 | local seconds1 = math.random(10,35) 935 | local circles1 = 1 936 | local success1 = exports['qb-lock']:StartLockPickCircle(circles1, seconds1, success1) 937 | if success1 then 938 | local seconds2 = math.random(10,35) 939 | local circles2 = 1 940 | local success2 = exports['qb-lock']:StartLockPickCircle(circles2, seconds2, success2) 941 | if success2 then 942 | ClearPedTasksImmediately(PlayerPedId()) 943 | DeleteEntity(baitAnimal) 944 | TriggerServerEvent('Leux-hunting:wolfReward') 945 | end 946 | end 947 | end 948 | else 949 | QBCore.Functions.Notify("You need a knife", "error") 950 | end 951 | else 952 | QBCore.Functions.Notify("You have already skinned 1 animal for the bait or this is another hunters animal", "error") 953 | end 954 | end) 955 | 956 | RegisterNetEvent('Leux-hunting:skinbigfoot') 957 | AddEventHandler('Leux-hunting:skinbigfoot', function() 958 | local weapon = GetSelectedPedWeapon(PlayerPedId()) 959 | if DoesEntityExist(baitAnimal) then 960 | if QBCore.Shared.Weapons[weapon]["name"] ~= "weapon_unarmed" and not QBCore.Shared.Weapons["weapon_huntingrifle"] then 961 | LoadAnimDict('amb@medic@standing@kneel@base') 962 | LoadAnimDict('anim@gangops@facility@servers@bodysearch@') 963 | TaskPlayAnim(PlayerPedId(), "amb@medic@standing@kneel@base" ,"base" ,8.0, -8.0, -1, 1, 0, false, false, false ) 964 | TaskPlayAnim(PlayerPedId(), "anim@gangops@facility@servers@bodysearch@" ,"player_search" ,8.0, -8.0, -1, 48, 0, false, false, false ) 965 | QBCore.Functions.Progressbar("eat_something", "Skinning Bigfoot..", 5000) 966 | Citizen.Wait(5000) 967 | TriggerEvent('animations:client:EmoteCommandStart', {"medic"}) 968 | local seconds = math.random(10,35) 969 | local circles = 1 970 | local success = exports['qb-lock']:StartLockPickCircle(circles, seconds, success) 971 | if success then 972 | local seconds1 = math.random(10,35) 973 | local circles1 = 1 974 | local success1 = exports['qb-lock']:StartLockPickCircle(circles1, seconds1, success1) 975 | if success1 then 976 | local seconds2 = math.random(10,35) 977 | local circles2 = 1 978 | local success2 = exports['qb-lock']:StartLockPickCircle(circles2, seconds2, success2) 979 | if success2 then 980 | ClearPedTasksImmediately(PlayerPedId()) 981 | DeleteEntity(baitAnimal) 982 | TriggerServerEvent('Leux-hunting:bigfootReward') 983 | end 984 | end 985 | end 986 | else 987 | QBCore.Functions.Notify("You need a knife", "error") 988 | end 989 | else 990 | QBCore.Functions.Notify("You have already skinned 1 animal for the bait or this is another hunters animal", "error") 991 | end 992 | end) 993 | 994 | RegisterNetEvent('Leux-hunting:skinmtlion') 995 | AddEventHandler('Leux-hunting:skinmtlion', function() 996 | local weapon = GetSelectedPedWeapon(PlayerPedId()) 997 | if DoesEntityExist(baitAnimal) then 998 | if QBCore.Shared.Weapons[weapon]["name"] ~= "weapon_unarmed" and not QBCore.Shared.Weapons["weapon_huntingrifle"] then 999 | LoadAnimDict('amb@medic@standing@kneel@base') 1000 | LoadAnimDict('anim@gangops@facility@servers@bodysearch@') 1001 | TaskPlayAnim(PlayerPedId(), "amb@medic@standing@kneel@base" ,"base" ,8.0, -8.0, -1, 1, 0, false, false, false ) 1002 | TaskPlayAnim(PlayerPedId(), "anim@gangops@facility@servers@bodysearch@" ,"player_search" ,8.0, -8.0, -1, 48, 0, false, false, false ) 1003 | QBCore.Functions.Progressbar("eat_something", "Skinning Mountain Lion..", 5000) 1004 | Citizen.Wait(5000) 1005 | TriggerEvent('animations:client:EmoteCommandStart', {"medic"}) 1006 | local seconds = math.random(10,35) 1007 | local circles = 1 1008 | local success = exports['qb-lock']:StartLockPickCircle(circles, seconds, success) 1009 | if success then 1010 | local seconds1 = math.random(10,35) 1011 | local circles1 = 1 1012 | local success1 = exports['qb-lock']:StartLockPickCircle(circles1, seconds1, success1) 1013 | if success1 then 1014 | local seconds2 = math.random(10,35) 1015 | local circles2 = 1 1016 | local success2 = exports['qb-lock']:StartLockPickCircle(circles2, seconds2, success2) 1017 | if success2 then 1018 | ClearPedTasksImmediately(PlayerPedId()) 1019 | DeleteEntity(baitAnimal) 1020 | TriggerServerEvent('Leux-hunting:mountainlionReward') 1021 | end 1022 | end 1023 | end 1024 | else 1025 | QBCore.Functions.Notify("You need a knife", "error") 1026 | end 1027 | else 1028 | QBCore.Functions.Notify("You have already skinned 1 animal for the bait or this is another hunters animal", "error") 1029 | end 1030 | end) 1031 | 1032 | Citizen.CreateThread(function() 1033 | while true do 1034 | Wait(1000) 1035 | if DoesEntityExist(baitAnimal) then 1036 | local ped = PlayerPedId() 1037 | local coords = GetEntityCoords(PlayerPedId()) 1038 | local animalCoords = GetEntityCoords(baitAnimal) 1039 | local dst = #(coords - animalCoords) 1040 | HideHudComponentThisFrame(14) 1041 | if dst < 2.5 then -- spook animal 1042 | TaskCombatPed(baitAnimal,ped,0,16) 1043 | end 1044 | end 1045 | end 1046 | end) 1047 | 1048 | 1049 | 1050 | RegisterCommand('getzone', function() 1051 | Coords = GetEntityCoords(PlayerPedId()) 1052 | ZoneName = GetNameOfZone(Coords) 1053 | print(ZoneName) 1054 | end) 1055 | 1056 | RegisterCommand('testhuntingspawn',function() 1057 | TriggerEvent('Leux-hunting:spawnAnimal') 1058 | end) 1059 | 1060 | RegisterCommand('testpoachingspawn',function() 1061 | TriggerEvent('Leux-hunting:spawnAnimal') 1062 | end) 1063 | --------------------------------------------------------------------------------