đŸ”Ŧ
RX Scripts
STOREDISCORD
  • 👋Overview
  • Find us
    • 🔗Store
    • 🔗Discord
    • 🔗Youtube
  • 🌐Scripts
    • Garages
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Reports PRO
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Mining
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Fishing
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Player Stores
      • đŸ› ī¸Installation
      • 🚚Jobs DLC
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Drug Labs
      • đŸ› ī¸Installation
      • âœˆī¸Operation DLC
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Hunting
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Plantation
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Gang Wars
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Housing
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Chopshop
      • đŸ› ī¸Installation
      • 📝Configurables
    • Death System
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Recyclers
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Smelters
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Crates & Storages
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Exports
      • â†Šī¸Events
    • Black Markets
      • đŸ› ī¸Installation
      • 📝Configurables
    • Hazard Zones
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Report System
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Billing System
      • đŸ› ī¸Installation
      • â†Ēī¸Exports
      • â†Šī¸Events
Powered by GitBook
On this page
  • Config Files
  • Opensource Files
  1. Scripts
  2. Hunting

Configurables

Config Files

--[[
BY RX Scripts Š rxscripts.xyz
--]]

--[[
    HUNTING ZONES CAN BE FOUND IN config/zones.lua
    ANIMALS CAN BE FOUND IN config/animals.lua
    CUT WEAPONS CAN BE FOUND IN config/cutweapons.lua
    LEVELS CAN BE FOUND IN config/levels.lua
    BAITS CAN BE FOUND IN config/usables.lua
    MISSIONS CAN BE FOUND IN config/missions.lua
    TRANSLATIONS CAN BE FOUND IN locales/*.lua
    IN HERE YOU CAN FIND THE MORE GENERIC / NOT VERY LONG LISTS CONFIGURATIONS
--]]

Config = {}

Config.SaveInterval = 10 -- Minutes (Set to 'false' to disable saving on interval, only on server shutdown, or important reached levels)
Config.DiscordWebhook = '' -- Discord webhook to send important logs (Set to '' to disable)
Config.Locale = 'en'
Config.ImgDirectory = 'ox_inventory/web/images/' -- The directory where the images are stored.

Config.CutType = 'target' -- 'melee' or 'keybind' or 'target'
Config.CutKeyMap = { map = 'keyboard', key = 'r' } -- key to start cut if CutType is 'keybind'
Config.CutCooldown = 0 -- Cooldown of cutting in seconds for when you're using CutType 'keybind'

Config.HuntingLicense = {
    enabled = true, -- Set to false to disable the whole hunting license
    buyable = true, -- Set to false to disable buying the license, use exports to give the license to a player
    price = 1500,
    moneyType = 'bank',
    restricts = {
        cutting = true, -- If true, you need a hunting license to cut animals, if false, you can cut animals without a license
        killing = true, -- If true, killing without a license will notify the police and killing will give no benefits
        shopNPC = true, -- If true, you need a hunting license to open the shop NPC
        sellNPC = true, -- If true, you need a hunting license to open the sell NPC
        huntingNPC = true, -- If true, you need a hunting license to open the hunting NPC
    },
}

Config.HuntingNPC = { -- NPC to buy hunting license (if enabled) & see routes, level etc..
    enabled = true, -- Set to false to disable the hunting NPC
    coords = vector3(-1101.1428, 4940.5693, 217.3545),
    heading = 246.7530,
    model = 's_m_y_ammucity_01',
    blip = {
        enabled = true,
        sprite = 141,
        color = 73,
        label = 'Hunter',
        display = 2,
        scale = 0.7,
        shortrange = true,
    },
}

Config.WeaponBlock = { -- These weapons will be blocked for using on other players (to create specifical hunting weapons)
    enabled = true,
    weapons = {
        'WEAPON_KNIFE',
        'WEAPON_SWITCHBLADE',
        'WEAPON_HATCHET',
        'WEAPON_BATTLEAXE',
        'WEAPON_MUSKET',
        'WEAPON_DBSHOTGUN',
        'WEAPON_MARKSMANPISTOL',
        'WEAPON_MARKSMANRIFLE',
    },
}

Config.ShopNPC = { -- NPC that opens a shop
    enabled = true, -- Set to false to disable the shop npc
    route = true, -- If true, the shop NPC will have a route in the hunting npc
    label = 'Hunting Shop',
    moneyType = 'bank',
    model = 's_m_y_ammucity_01',
    coords = vector3(-1075.3329, 4898.0054, 213.2714),
    heading = 357.4609,
    blip = {
        enabled = true,
        sprite = 141,
        color = 73,
        display = 2,
        scale = 0.7,
        shortrange = true,
    },
    categories = {
        ['Baits'] = {
            { item = 'boar_meat',       amount = 1, price = 2500,   label = 'Dead Boar Bait',   requiredLevel = 1,  mystery = false },
            { item = 'deer_horn',       amount = 1, price = 1500,   label = 'Deer Horn',        requiredLevel = 2,  mystery = false },
            { item = 'meat_stand',      amount = 1, price = 5000,   label = 'Meat Stand Bait',  requiredLevel = 2,  mystery = false },
            { item = 'deer',            amount = 1, price = 7500,   label = 'Dead Deer Bait',   requiredLevel = 3,  mystery = true  },
        },
        ['Cut Weapons'] = {
            { item = 'WEAPON_HATCHET',      amount = 1, price = 1000,   label = 'Hatchet',      requiredLevel = 0,  mystery = false },
            { item = 'WEAPON_SWITCHBLADE',  amount = 1, price = 2000,   label = 'Switchblade',  requiredLevel = 1,  mystery = false },
            { item = 'WEAPON_KNIFE',        amount = 1, price = 3000,   label = 'Knife',        requiredLevel = 3,  mystery = true  },
            { item = 'WEAPON_BATTLEAXE',    amount = 1, price = 7000,   label = 'Battleaxe',    requiredLevel = 6,  mystery = true  },
        },
        ['Hunting Weapons'] = {
            { item = 'WEAPON_MARKSMANPISTOL',   amount = 1,     price = 5000,   label = 'Marksman Pistol',          requiredLevel = 0,  mystery = false },
            { item = 'WEAPON_MUSKET',           amount = 1,     price = 10000,  label = 'Musket',                   requiredLevel = 3,  mystery = true  },
            { item = 'WEAPON_DBSHOTGUN',        amount = 1,     price = 15000,  label = 'Double Barrel Shotgun',    requiredLevel = 4,  mystery = true  },
            { item = 'WEAPON_MARKSMANRIFLE',    amount = 1,     price = 20000,  label = 'Marksman Rifle',           requiredLevel = 6,  mystery = true  },
            { item = 'ammo-22',                 amount = 20,    price = 1000,   label = 'Marksman Pistol Ammo',     requiredLevel = 0,  mystery = false },
            { item = 'ammo-musket',             amount = 20,    price = 2000,   label = 'Musket Ammo',              requiredLevel = 3,  mystery = true  },
            { item = 'ammo-shotgun',            amount = 20,    price = 3000,   label = 'Shotgun Ammo',             requiredLevel = 4,  mystery = true  },
            { item = 'ammo-sniper',             amount = 20,    price = 5000,   label = 'Sniper Ammo',              requiredLevel = 6,  mystery = true  },
        },
    },
}

Config.SellNPC = { -- NPC that opens a shop to sell hunting stuff
    enabled = true, -- Set to false to disable the selling shop npc
    route = true, -- If true, the sell NPC will have a route in the hunting npc
    label = 'Hunt Selling',
    moneyType = 'bank',
    model = 's_m_y_ammucity_01',
    coords = vector3(-1112.9452, 4903.7397, 217.5952),
    heading = 310.2702,
    blip = {
        enabled = true,
        sprite = 141,
        color = 73,
        display = 2,
        scale = 0.7,
        shortrange = true,
    },
    categories = { -- Price is per 1
        ['Animals Loot'] = {
            { item = 'animal_fat',      price = 30,   label = 'Animal Fat',     requiredLevel = 0,  mystery = false },
            { item = 'bone_fragments',  price = 50,   label = 'Bone Fragments', requiredLevel = 0,  mystery = false },
            { item = 'raw_pork',        price = 40,   label = 'Raw Pork',       requiredLevel = 0,  mystery = false },
            { item = 'cloth',           price = 80,   label = 'Cloth',          requiredLevel = 0,  mystery = false  },
            { item = 'leather',         price = 200,  label = 'Leather',        requiredLevel = 0,  mystery = false  },
        },
    },
}

--[[
    INITIALIZATION SECTION

    ONLY UNCOMMENT/CHANGE THIS IF YOU HAVE RENAMED SCRIPTS SUCH AS FRAMEWORK, TARGET, INVENTORY ETC
    RENAME THE SCRIPT NAME TO THE NEW NAME
--]]

-- FM = 'fmLib'
-- OXTarget = 'ox_target'
-- QBTarget = 'qb-target'
-- OXInv = 'ox_inventory'
IgnoreResourceNotFoundErrors = false
IgnoreResourceInitializedLogs = false
--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config.OnlySpawned = true -- If true, only animals spawned by the script can be used for our features (true is recommended)
Config.AnimalCleanup = false -- If true, animals spawned by the script will be deleted when getting out of the hunting zone
Config.AnimalProofs = {
    bullet = false,
    fire = false,
    explosion = false,
    collision = true,
    melee = false,
    steam = false,
    drown = false,
}

Config.Animals = {
    ['Pig'] = { -- Must be unique
        label = 'Pig',
        model = 'a_c_pig', -- We suggest making this unique if using Config.OnlySpawned = false
        attacker = false, -- If the animal should attack the player instead of running away, only works for animals that are attackers by GTA already
        spawnChance = 30, -- Recommended to keep between 1 - 100 (individual chance, no need to sum all animals up to 100)
        requiredLevel = 0, -- Required level to cut the animal
        cutTimes = 3, -- Amount of times the animal can be cut (in total, so if multiple players are cutting the animal, it will be cut faster)
        lootLoop = 2, -- Amount of times something out of the loot table will be given each cut (e.g. 1x animal_fat, 1x bone_fragments)
        loot = {
            { item = 'animal_fat', min = 1, max = 3, chance = 40 },
            { item = 'bone_fragments', min = 1, max = 3, chance = 25 },
            { item = 'cloth', min = 1, max = 2, chance = 15 },
            { item = 'leather', min = 1, max = 1, chance = 5 },
            { item = 'raw_pork', min = 1, max = 3, chance = 10 },
        },
        xp = {
            cutGain = 5, -- XP gained from cutting the animal
            killGain = 10, -- XP gained from killing the animal
        },
        weapons = { -- Weapons that can be used to cut the animal, can be found in config/cutweapons.lua
            Config.CutWeapons['WEAPON_HATCHET'],
            Config.CutWeapons['WEAPON_SWITCHBLADE'],
            Config.CutWeapons['WEAPON_KNIFE'],
            Config.CutWeapons['WEAPON_BATTLEAXE'],
        },
    },
    ['Cow'] = {
        model = 'a_c_cow',
        label = 'Cow',
        attacker = false,
        spawnChance = 20,
        requiredLevel = 0,
        cutTimes = 4,
        lootLoop = 3,
        loot = {
            { item = 'animal_fat', min = 1, max = 3, chance = 40 },
            { item = 'bone_fragments', min = 1, max = 3, chance = 25 },
            { item = 'cloth', min = 1, max = 2, chance = 15 },
            { item = 'leather', min = 1, max = 1, chance = 5 },
            { item = 'raw_pork', min = 1, max = 3, chance = 10 },
        },
        xp = {
            cutGain = 10,
            killGain = 15,
        },
        weapons = {
            Config.CutWeapons['WEAPON_HATCHET'],
            Config.CutWeapons['WEAPON_SWITCHBLADE'],
            Config.CutWeapons['WEAPON_KNIFE'],
            Config.CutWeapons['WEAPON_BATTLEAXE'],
        },
    },
    ['Boar'] = {
        model = 'a_c_boar',
        label = 'Boar',
        attacker = false,
        spawnChance = 20,
        requiredLevel = 1,
        cutTimes = 4,
        lootLoop = 2,
        loot = {
            { item = 'animal_fat', min = 1, max = 3, chance = 40 },
            { item = 'bone_fragments', min = 1, max = 3, chance = 25 },
            { item = 'cloth', min = 1, max = 2, chance = 15 },
            { item = 'leather', min = 1, max = 1, chance = 5 },
            { item = 'raw_pork', min = 1, max = 3, chance = 10 },
        },
        xp = {
            cutGain = 15,
            killGain = 25,
        },
        weapons = {
            Config.CutWeapons['WEAPON_HATCHET'],
            Config.CutWeapons['WEAPON_SWITCHBLADE'],
            Config.CutWeapons['WEAPON_KNIFE'],
            Config.CutWeapons['WEAPON_BATTLEAXE'],
        },
    },
    ['Deer'] = {
        model = 'a_c_deer',
        label = 'Deer',
        attacker = false,
        spawnChance = 15,
        requiredLevel = 2,
        cutTimes = 4,
        lootLoop = 3,
        loot = {
            { item = 'animal_fat', min = 1, max = 3, chance = 40 },
            { item = 'bone_fragments', min = 1, max = 3, chance = 25 },
            { item = 'cloth', min = 1, max = 2, chance = 15 },
            { item = 'leather', min = 1, max = 1, chance = 5 },
            { item = 'raw_pork', min = 1, max = 3, chance = 10 },
        },
        xp = {
            cutGain = 25,
            killGain = 40,
        },
        weapons = {
            Config.CutWeapons['WEAPON_HATCHET'],
            Config.CutWeapons['WEAPON_SWITCHBLADE'],
            Config.CutWeapons['WEAPON_KNIFE'],
            Config.CutWeapons['WEAPON_BATTLEAXE'],
        },
    },
    ['Coyote'] = {
        model = 'a_c_coyote',
        label = 'Coyote',
        attacker = true,
        spawnChance = 10,
        requiredLevel = 3,
        cutTimes = 3,
        lootLoop = 2,
        loot = {
            { item = 'animal_fat', min = 1, max = 3, chance = 40 },
            { item = 'bone_fragments', min = 1, max = 3, chance = 25 },
            { item = 'cloth', min = 1, max = 2, chance = 15 },
            { item = 'leather', min = 1, max = 1, chance = 5 },
            { item = 'raw_pork', min = 1, max = 3, chance = 10 },
        },
        xp = {
            cutGain = 30,
            killGain = 60,
        },
        weapons = {
            Config.CutWeapons['WEAPON_HATCHET'],
            Config.CutWeapons['WEAPON_SWITCHBLADE'],
            Config.CutWeapons['WEAPON_KNIFE'],
            Config.CutWeapons['WEAPON_BATTLEAXE'],
        },
    },
    ['Lion'] = {
        model = 'a_c_mtlion',
        label = 'Lion',
        attacker = true,
        spawnChance = 5,
        requiredLevel = 6,
        cutTimes = 5,
        lootLoop = 4,
        loot = {
            { item = 'animal_fat', min = 1, max = 3, chance = 40 },
            { item = 'bone_fragments', min = 1, max = 3, chance = 25 },
            { item = 'cloth', min = 1, max = 2, chance = 15 },
            { item = 'leather', min = 1, max = 1, chance = 5 },
            { item = 'raw_pork', min = 1, max = 3, chance = 10 },
        },
        xp = {
            cutGain = 50,
            killGain = 100,
        },
        weapons = {
            Config.CutWeapons['WEAPON_BATTLEAXE'],
        },
    },
}
--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config.HuntingZones = {
    ['Zone Poly'] = {
        maxAnimals = 20, -- Max animals in the zone
        spawnInterval = 180, -- Time in seconds between each spawned animal
        zone = { -- Zone data (https://overextended.dev/ox_lib/Modules/Zones/Shared#libzonespoly)
            type = 'poly',
            thickness = 900, -- Height of the poly
            debug = true,
            points = {
                vector3(-618.2573, 4979.1455, 550.0),
                vector3(-546.2692, 5077.0786, 550.0),
                vector3(-91.0084, 5085.8071, 550.0),
                vector3(-254.3245, 4746.7788, 550.0),
                vector3(-656.8680, 4794.6660, 550.0),
            }
        },
        animals = { -- Key from config/animals.lua
            'Pig',
            'Cow',
            'Boar',
            'Deer',
            'Coyote',
            'Lion',
        },
        route = {
            enabled = false,
            coords = { x = -618.2573, y = 4979.1455},
        }
    },
    ['Zone Box'] = {
        maxAnimals = 20,
        spawnInterval = 180,
        zone = {
            type = 'box',
            coords = vector3(-909.0355, 4788.1802, 200.0),
            size = vector3(150.0, 150.0, 600.0),
            rotation = 0,
            debug = true,
        },
        animals = {
            'Pig',
            'Cow',
            'Boar',
            'Deer',
            'Coyote',
            'Lion',
        },
        route = {
            enabled = true,
            coords = { x = -909.0355, y = 4788.1802},
        }
    },
    ['Zone Sphere'] = {
        maxAnimals = 10,
        spawnInterval = 180,
        zone = {
            type = 'sphere',
            coords = vector3(-689.2698, 3632.1519, 294.9303),
            radius = 150,
            debug = true,
        },
        animals = {
            'Pig',
            'Pig',
            'Cow',
            'Boar',
            'Deer',
            'Coyote',
            'Lion',
        },
        route = {
            enabled = true,
            coords = { x = -689.2698, y = 3632.1519},
        }
    }
}
--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config.MaxMissions = 6 -- Max amount of missions that can be active at the same time (make sure its 1 less than the amount of missions in the table below so it can rotate)

Config.Missions = {
    ["Kill 5x Pig"] = {
        endTime = 12, -- Time in hours to complete the mission (after this a random other mission will start)
        type = 'kills', -- 'kills' or 'cuts'
        amount = 5, -- Amount of kills or cuts required
        animal = 'Pig', -- Animal to kill or cut (key from config/animals.lua)
        rewards = {
            xp = 50, -- Set to 0 to disable
            money = 1000, -- Set to 0 to disable
            moneyType = 'bank',
            items = { -- Empty table to disable
                { item = 'boar', amount = 1 },
                { item = 'boar_stand', amount = 1 },
            }
        }
    },
    ["Kill 3x Lion"] = {
        endTime = 24,
        type = 'kills',
        amount = 3,
        animal = 'Lion',
        rewards = {
            xp = 100,
            money = 2000,
            moneyType = 'bank',
            items = {
                { item = 'boar_stand', amount = 2 },
                { item = 'deer_horn', amount = 1 },
            }
        }
    },
    ["Cut 15x Coyote"] = {
        endTime = 24,
        type = 'cuts',
        amount = 15,
        animal = 'Coyote',
        rewards = {
            xp = 100,
            money = 1500,
            moneyType = 'bank',
            items = {
                { item = 'boar_stand', amount = 1 },
                { item = 'deer', amount = 1 },
            }
        },
    },
    ["Cut 15x Cow"] = {
        endTime = 12,
        type = 'cuts',
        amount = 15,
        animal = 'Cow',
        rewards = {
            xp = 100,
            money = 1000,
            moneyType = 'bank',
            items = {
                { item = 'boar_stand', amount = 1 },
                { item = 'boar', amount = 2 },
            }
        },
    },
    ["Cut 15x Lion"] = {
        endTime = 48,
        type = 'cuts',
        amount = 15,
        animal = 'Lion',
        rewards = {
            xp = 200,
            money = 1500,
            moneyType = 'bank',
            items = {
                { item = 'deer_horn', amount = 1 },
                { item = 'boar_stand', amount = 1 },
                { item = 'deer', amount = 2 },
            }
        },
    },
    ["Cut 10x Boar"] = {
        endTime = 24,
        type = 'cuts',
        amount = 10,
        animal = 'Boar',
        rewards = {
            xp = 100,
            money = 1000,
            moneyType = 'bank',
            items = {
                { item = 'boar', amount = 1 },
                { item = 'boar_stand', amount = 1 },
                { item = 'deer', amount = 1 },
            }
        },
    },
    ["Kill 5x Deer"] = {
        endTime = 48,
        type = 'cuts',
        amount = 5,
        animal = 'Deer',
        rewards = {
            xp = 100,
            money = 1000,
            moneyType = 'bank',
            items = {
                { item = 'deer', amount = 2 },
                { item = 'deer_horn', amount = 1 },
            }
        },
    },
}
--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config.Baits = {
    ['boar_meat'] = { -- Item name to place the bait
        requiredLevel = 1, -- Required level to use this bait
        prop = 'rx_meat_big', -- Prop to place on the ground
        maxAttracts = 5, -- Max amount of animals that will be attracted
        onlyZone = true, -- Can only be used in hunting zones
        attractTime = { min = 3, max = 5 }, -- Random time in minutes the bait will attract animals
        attracts = { -- Animals that will be attracted by this bait (key from config/animals.lua)
            'Pig',
            'Cow',
        }
    },
    ['meat_stand'] = {
        requiredLevel = 2,
        prop = 'rx_standmeat',
        maxAttracts = 8,
        onlyZone = true,
        attractTime = { min = 2, max = 3 },
        attracts = {
            'Cow',
            'Pig',
            'Boar',
            'Deer',
            'Coyote',
            'Lion',
        }
    },
    ['deer'] = {
        requiredLevel = 4,
        prop = 'rx_deerdead',
        maxAttracts = 5,
        onlyZone = true,
        attractTime = { min = 3, max = 5 },
        attracts = {
            'Coyote',
            'Lion',
        }
    }
}

Config.Calls = { -- Shows animals on the map
    ['deer_horn'] = { -- Item name to use the call
        label = "Deer Call",
        requiredLevel = 2, -- Required level to use this call
        radius = 200, -- Radius in meters the call will show animals
        remove = true, -- Remove the call after using it
        duration = 60, -- Duration in seconds the call will show animals
        onlyZone = true, -- Can only be used in hunting zones
        shows = { -- Animals that will be shown by this call (key from config/animals.lua)
            'Deer',
        },
        blip = { -- Blip that will be shown on the map
            sprite = 141,
            color = 73,
            label = 'Deer',
            display = 2,
            scale = 0.7,
            shortrange = false,
        },
    }
}
--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config.CutWeapons = {
    ['WEAPON_HATCHET'] = {
        hash = joaat('WEAPON_HATCHET'),
        requiredLevel = 0, -- Level required to use this weapon for cutting
        multipliers = {
            lootAmount = 1, -- 1x loot amount
            xpGain = 1.0, -- 0% more xp on cutting (1.0 is 100%)
        },
    },
    ['WEAPON_SWITCHBLADE'] = {
        hash = joaat('WEAPON_SWITCHBLADE'),
        requiredLevel = 1,
        multipliers = {
            lootAmount = 1,
            xpGain = 1.1,
        },
    },
    ['WEAPON_KNIFE'] = {
        hash = joaat('WEAPON_KNIFE'),
        requiredLevel = 3,
        multipliers = {
            lootAmount = 2,
            xpGain = 1.2,
        },
    },
    ['WEAPON_BATTLEAXE'] = {
        hash = joaat('WEAPON_BATTLEAXE'),
        requiredLevel = 6,
        multipliers = {
            lootAmount = 3,
            xpGain = 1.3,
        },
    },
}

Opensource Files

--[[
BY RX Scripts Š rxscripts.xyz
--]]

local cutTargetLabel = 'Cut'

function InitAnimalTargets(animals)
    local opts = {
        {
            label = cutTargetLabel,
            icon = 'fas fa-cut',
        }
    }

    if OXTarget then
        opts[1].name = 'cut' -- don't change this
        opts[1].onSelect = function(data)
            CutAnimal(data.entity)
        end
        opts[1].canInteract = function(entity, distance, coords, name, bone) return not CutOnCd and IsEntityDead(entity) end
        opts[1].distance = 2.5

        OXTarget:addModel(animals, opts)
    elseif QBTarget then
        opts[1].action = function(entity)
            CutAnimal(entity)
        end
        opts[1].canInteract = function(entity, distance, data) return not CutOnCd and IsEntityDead(entity) end

        QBTarget.AddTargetModel(v.model, {
            options = opts,
            distance = 2.5,
        })
    end
end

function RemoveAnimalTargets(animals)
    if OXTarget then
        OXTarget:removeModel(animals, 'cut')
    elseif QBTarget then
        QBTarget:RemoveTargetModel(animals, cutTargetLabel)
    end
end

function AddHuntingNPCTarget(ped)
    if OXTarget then
        OXTarget:addLocalEntity(ped, {
            {
                label = 'Open Hunter',
                name = 'openHuntingNPC',
                icon = 'fas fa-hiking',
                distance = 2.5,
                onSelect = function(data)
                    OpenHuntingUI()
                end,
            }
        })
    elseif QBTarget then
        QBTarget:AddTargetEntity(ped, {
            options = {
                {
                    label = 'Open Hunter',
                    icon = 'fas fa-hiking',
                    targeticon = 'fas fa-hiking',
                    action = function(entity)
                        OpenHuntingUI()
                    end,
                }
            },
            distance = 2.5,
        })
    end
end

function AddShopNPCTarget(npc)
    if OXTarget then
        OXTarget:addLocalEntity(npc, {
            {
                label = 'Open Hunting Shop',
                name = 'openHuntingShop',
                icon = 'fas fa-shopping-cart',
                distance = 2.5,
                onSelect = function(data)
                    OpenShopNPC()
                end,
            }
        })
    elseif QBTarget then
        QBTarget:AddTargetEntity(npc, {
            options = {
                {
                    label = 'Open Hunting Shop',
                    icon = 'fas fa-shopping-cart',
                    targeticon = 'fas fa-shopping-cart',
                    action = function(entity)
                        OpenShopNPC()
                    end,
                }
            },
            distance = 2.5,
        })
    end
end

function AddSellNPCTarget(npc)
    if OXTarget then
        OXTarget:addLocalEntity(npc, {
            {
                label = 'Open Hunting Selling',
                name = 'openHuntingSelling',
                icon = 'fas fa-shopping-cart',
                distance = 2.5,
                onSelect = function(data)
                    OpenSellNPC()
                end,
            }
        })
    elseif QBTarget then
        QBTarget:AddTargetEntity(npc, {
            options = {
                {
                    label = 'Open Hunting Selling',
                    icon = 'fas fa-shopping-cart',
                    targeticon = 'fas fa-shopping-cart',
                    action = function(entity)
                        OpenSellNPC()
                    end,
                }
            },
            distance = 2.5,
        })
    end
end

function RemoveShopNPCTarget(ped)
    if OXTarget then
        OXTarget:removeLocalEntity(ped, 'openHuntingShop')
    elseif QBTarget then
        QBTarget:RemoveTargetEntity(ped, 'Open Hunting Shop')
    end
end

function RemoveSellNPCTarget(ped)
    if OXTarget then
        OXTarget:removeLocalEntity(ped, 'openHuntingSelling')
    elseif QBTarget then
        QBTarget:RemoveTargetEntity(ped, 'Open Hunting Selling')
    end
end

function RemoveHuntingNPCTarget(ped)
    if OXTarget then
        OXTarget:removeLocalEntity(ped, 'openHuntingNPC')
    elseif QBTarget then
        QBTarget:RemoveTargetEntity(ped, 'Open Hunter')
    end
end

function StartCutProgress(animalNetId, weaponHash)
    if FM.progress.start({
        label = 'Cutting..',
        time = 1000,
        canCancel = true,
        type = 'circle',
        failedLabel = 'Cutting failed!',
        completedLabel = 'Cutting completed!',
        anim = {
            dict = 'melee@knife@streamed_core',
            anim = 'ground_attack_on_spot',
        },
    }) then
        CutAnimalByProgress(animalNetId, weaponHash)
    else
        CutOnCd = false
    end
end

function GetFullPlayerName()
    return FM.callback.sync('hunting:getFullPlayerName')
end

function GetPlacingBaitCoords()
    local coords = GetEntityCoords(PlayerPedId())
    local forward = GetEntityForwardVector(PlayerPedId())
    coords = coords + forward
    local ret, z = GetGroundZFor_3dCoord(coords.x, coords.y, coords.z, 0, false)
    coords = vector3(coords.x, coords.y, z)
  
    local heading = GetEntityHeading(PlayerPedId())

    return coords, heading
end

function PlayPlaceBaitAnim()
    FM.anim.play({
        anim = 'base',
        dict = 'amb@world_human_gardener_plant@male@base',
        duration = 3000,
    })
end
--[[
BY RX Scripts Š rxscripts.xyz
--]]

function GetPoliceSources()
    local players = FM.utils.getPlayers()
    local policeSources = {}

    for src, p in pairs(players) do
        if p.getJob().name == 'police' then
            policeSources[#policeSources+1] = src
        end
    end

    return policeSources
end

function GetPlayerFullName(src)
    local p = FM.player.get(src)
    return p and p.getFullName() or 'Mr. Nobody'
end

function HasHuntingLicense(src)
    local p = FM.player.get(src)
    if not p then return false end

    local identifier = p.getIdentifier()
    if not Hunters[identifier] then return false end

    return Hunters[identifier].license
end

--[[
    esx_licenses INTEGRATION FOR CHECKING HUNTING LICENSE
    UNCOMMENT FUNCTION BELOW
    RENAME 'hunting_license_name_here' TO YOUR HUNTING LICENSE NAME
    REMOVE/COMMENT THE FUNCTION ABOVE: function HasHuntingLicense(src) ...... end
]]
-- function HasHuntingLicense(src)
--     local hasLicense = promise.new()

--     TriggerEvent('esx_license:checkLicense', src, 'hunting_license_name_here', function(bool)
--         hasLicense:resolve(bool)
--     end)

--     return Citizen.Await(hasLicense)
-- end

FM.callback.register('hunting:getFullPlayerName', function(src)
    return GetPlayerFullName(src)
end)

RegisterNetEvent('hunting:onLicenseBought', function(playerId)
    -- This event will be called whenever a player bought a hunting license
end)
PreviousInstallationNextExports

Last updated 11 months ago

🌐
📝