What features does the hunting script offer? What is it?
π Hunting Zones:
There are different hunting areas available
Hunting areas have different animals and rarity values!
You can adjust the spawn time and spawn rate of animals within the area!
π Missions:
You can accept mission and earn extra money and XP
You can create custom missions based on level.
π’ Levels:
The desired amount of levels can be set.
A multiplier specific to levels can be set. This multiplier affects the XP gained when tanning animal hides and the money earned when selling animal parts. You gain an additional amount equal to the multiplier.
The XP required for levels and the default level can be adjusted.
π« Animals:
Animals specific to each area can be placed
The XP and animal parts (items) awarded when an animal's skin is removed can be customized based on the animal.
The option to use knife types such as WEAPON_KNIFE for skinning animals is available in the config.
Animations and progress bars used for skinning animals are available in the config.
π Vehicles:
When the job is started, the vehicle model specified in Config will spawn.
The vehiclekey and fuel scripts for the vehicle will work with automatic integration.
π¦ Hunting Items ( Starter Items ):
You can configure the necessary weapons, ammunition, and other items for hunting from the table available in the Config.
Items given in situations such as leaving the area or exiting the server will be automatically deleted. It is not possible for me to take the items out of the hunting area.
πΌ Job Integration / Work with Job:
You can specify whether the job is required via the configuration.
It means that if the job can be done without requiring a specific profession, anyone can use this profession without changing their job and without requiring a specific job.
π§βπ§βπ§ Group:
The group limit can be set in Config. By default, groups of 4 people are available.
Players in the group can see each other on the map. This can be disabled in the Config.
When group tasks are completed, the reward can be divided and distributed among the group members. This feature can be disabled in Config.
π Admin Commands:
/givexp <id> <amount>: You can give the user hunting XP in this format.
/setxp <id> <amount>: You can set the user's hunting XP to a fixed value.
/setlevel <id> <level>: You can set the user's hunting level using this command.
Config = {}
Config.Framework = {
["Framework"] = "auto", -- auto, esx, qbcore or qbox
["ResourceName"] = "auto", -- auto, es_extended or qb-core or your resource name. If you using qbx you should write qb-core
["SharedEvent"] = "" -- Event name for old cores.
}
Config.Language = "en" -- ar, cz, ro, it, fr, de, tr
Config.ShowDebug = false -- If you set this to `true`, the debug messages will be printed in the console. If you set it to `false`, no debug messages will be printed.
Config.InviteTimeout = 10 * 1000 -- Time in milliseconds before an invite times out.
Config.InviteDistance = 5.0 -- The distance between the person being invited and the person doing the inviting. To prevent certain things from being abused and to prevent things like cheating.
Config.GroupPlayerLimit = 4 -- Maximum number of players allowed in a hunting group.
Config.GroupMemberBlips = true -- If you set it to `true`, group members' blips will be visible on the map. If you set it to `false`, group members' blips will not be shown.
Config.SplitMissionRewards = true -- If you set it to `true`, the total reward from the task is divided by the number of people in the group, and the reward per person is delivered. If you set it to `false`, the reward is given directly to everyone in the group in the specified amount.
Config.StartingItems = {
--[[
The names and amount of hunting items players will receive from the vehicle.
β οΈβ οΈβ οΈ
These items will be automatically deleted
if you leave the area after taking them, or if you log out of the server.
β οΈβ οΈβ οΈ
]]
{
-- Hunting weapon given to players when they start the job.
["name"] = "weapon_musket",
["amount"] = 1,
},
{
-- Ammunition for the hunting weapon given to players when they start the job.
-- detect_auto: If you are using the Ox inventory, it will automatically provide musket ammunition. If you are using another inventory, it will automatically provide shotgun ammunition.
-- If your musket ammunition is neither of these, please enter your musket ammunition.
["name"] = "detect_auto",
["amount"] = 100,
}
}
Config.Skinning = {
--[[
β οΈβ οΈβ οΈ
Settings related to skinning animals.
The 'knife' table contains settings for the knife item used in skinning.
The 'duration' value indicates how long the skinning animation will last in milliseconds.
]]
["knife"] = {
["must"] = false, -- If you set it to `true`, players must have a knife in their inventory to skin the animal. If you set it to `false`, no knife is required.
["name"] = "WEAPON_KNIFE", -- Name of the knife item.
["label"] = "Knife", -- Label of the knife item.
},
["duration"] = 5 * 1000, -- Time in milliseconds the animation will last.
["anim"] = {
["dict"] = "anim@gangops@facility@servers@bodysearch@", -- Animation dictionary to be played.
["clip"] = "player_search", -- Animation dictionary and clip to be played.
["flag"] = 1, -- Animation flag to control how the animation behaves.
},
}
Config.JobCenter = {
["job"] = {
["required"] = false, -- If you set it to `true`, only people with the specified job can access the menu. If it is `false`, anyone can perform the job without requiring a specific job title.
["name"] = "hunter", -- The name of the hunting job in Jobs.lua or the jobs table.
["grade"] = 0, -- The grade value of the hunting profession in the Jobs.lua or job_grades table.
},
["ped"] = {
["model"] = "mp_m_exarmy_01", -- Ped model for the job center.
["coords"] = vector4(-679.26, 5834.38, 17.33, 133.20), -- Coordinates for the job center ped.
["distance"] = 3.0, -- Interaction distance for the job center ped.
["created"] = function(entity) -- This function is called when the job center ped is created. You can use it for debugging or other purposes.
Config.Debug(('Job center ped created. Entity ID: %s'):format(entity))
end
},
["blips"] = {
["label"] = "Hunting Job", -- Blip label for the job center.
["coords"] = vector3(-679.26, 5834.38, 17.33), -- Blip coordinates for the job center.
["sprite"] = 141, -- Blip sprite for the job center.
["color"] = 5, -- Blip color for the job center.
["scale"] = 0.8, -- Blip scale for the job center.
["show"] = true, -- If you set it to `true`, the blip will be shown on the map. If you set it to `false`, the blip will not be displayed.
}
}
Config.Vehicle = {
--[[
Vehicle used for the hunting job.
- model: The model name of the vehicle.
- type: The type of vehicle (automobile, bike, etc.).
- outcoords: The coordinates where the vehicle will spawn when taken out for the job.
- controlDistance: The distance within which the player must remain from the vehicle while on the job. If the player exceeds this distance, the job will be canceled and the vehicle will be removed.
]]
["type"] = "automobile", -- Vehicle type [automobile, bike, boat, heli, plane, submarine, trailer and train]
["model"] = "mesa3", -- Vehicle model name
["maxDistance"] = 100.0, -- The maximum distance the player can be from the vehicle. If they exceed this distance, they will receive a warning every 5 seconds, and after 10 warnings, the vehicle will be deleted.
["controlDistance"] = 3.0, -- The width distance at which out coords will be monitored
["outcoords"] = {
--[[
Coordinates where the vehicle will spawn when taken out for the job.
]]
vec4(-677.6839, 5826.7158, 17.1025, 135.5928),
vec4(-680.4544, 5828.8892, 17.1015, 133.6158),
vec4(-683.1483, 5831.2280, 17.1018, 134.0365),
vec4(-685.2559, 5834.2231, 17.1021, 133.3776),
},
}
Config.Zones = {
--[[
β οΈβ οΈβ οΈ
Hunting zones where animals will spawn.
You can create multiple zones by copying and pasting the entire table structure below.
Each zone includes:
- coords: The center coordinates of the hunting zone.
- radius: The radius of the hunting zone.
- maxAnimals: Maximum number of animals that can be present in the zone at any given time.
- removeAnimal: The deletion period for animals that have died but for which no action has been taken. If an animal dies and is not skinned, it will be deleted within this period.
- spawnInterval: The interval at which new animals will spawn in the zone.
- blips: Settings for the blip that appears on the map for the hunting zone.
- animals: A table of animals that may appear in this area, along with their rarity and attack behavior.
β οΈβ οΈβ οΈ
]]
{
["coords"] = vector3(-576.35, 5938.56, 31.09), -- Center coordinates of the hunting zone
["radius"] = 80.0, -- Radius of the hunting zone
["maxAnimals"] = 25, -- Maximum number of animals that can be present in the zone at any given time
["removeAnimal"] = 0.5 * 60 * 1000, -- The deletion period for animals that have died but for which no action has been taken. If an animal dies and is not skinned, it will be deleted within this period.
["spawnInterval"] = 0.75 * 60 * 1000, -- A new animal will spawn every 0.75 minutes.
["blips"] = {
["show"] = true,
["label"] = "Hunting Zone",
["color"] = 5,
["scale"] = 0.7,
["sprite"] = 141,
["radius"] = {
["show"] = true,
["color"] = 5,
["alpha"] = 80,
}
},
["animals"] = {
--[[
β οΈβ οΈβ οΈ
This is a table of animals that may appear in this area.
The rarity value of all animals must total 1.0f
The 'canAttack' value determines whether the animal can attack the player or not.
]]
{
["model"] = "a_c_deer",
["rarity"] = 0.11,
},
{
["model"] = "a_c_mtlion",
["rarity"] = 0.20,
["canAttack"] = math.random(1, 10) >= 7 -- 30% chance to attack the player
},
{
["model"] = "a_c_rabbit_01",
["rarity"] = 0.10,
},
{
["model"] = "a_c_pig",
["rarity"] = 0.10,
},
{
["model"] = "a_c_boar",
["rarity"] = 0.39,
["canAttack"] = math.random(1, 10) >= 8 -- 20% chance to attack the player
}
},
},
{
["coords"] = vector3(1176.3206, 4575.3989, 116.9845), -- Center coordinates of the hunting zone
["radius"] = 80.0, -- Radius of the hunting zone
["maxAnimals"] = 25, -- Maximum number of animals that can be present in the zone at any given time
["removeAnimal"] = 0.5 * 60 * 1000, -- The deletion period for animals that have died but for which no action has been taken. If an animal dies and is not skinned, it will be deleted within this period.
["spawnInterval"] = 0.75 * 60 * 1000, -- A new animal will spawn every 0.75 minutes.
["blips"] = {
["show"] = true,
["label"] = "Hunting Zone",
["color"] = 5,
["scale"] = 0.7,
["sprite"] = 141,
["radius"] = {
["show"] = true,
["color"] = 5,
["alpha"] = 80,
}
},
["animals"] = {
--[[
β οΈβ οΈβ οΈ
This is a table of animals that may appear in this area.
The rarity value of all animals must total 1.0f
The 'canAttack' value determines whether the animal can attack the player or not.
]]
{
["model"] = "a_c_deer",
["rarity"] = 0.11,
},
{
["model"] = "a_c_mtlion",
["rarity"] = 0.20,
["canAttack"] = math.random(1, 10) >= 7 -- 30% chance to attack the player
},
{
["model"] = "a_c_rabbit_01",
["rarity"] = 0.10,
},
{
["model"] = "a_c_pig",
["rarity"] = 0.10,
},
{
["model"] = "a_c_boar",
["rarity"] = 0.39,
["canAttack"] = math.random(1, 10) >= 8 -- 20% chance to attack the player
}
},
},
{
["coords"] = vector3(-1448.56, 4640.55, 53.09),
["radius"] = 80.0,
["maxAnimals"] = 20, -- Maximum number of animals that can be present in the zone at any given time
["removeAnimal"] = 0.5 * 60 * 1000, -- The deletion period for animals that have died but for which no action has been taken. If an animal dies and is not skinned, it will be deleted within this period.
["spawnInterval"] = 1.0 * 60 * 1000, -- A new animal will spawn every 1 minutes.
["blips"] = {
["show"] = true,
["label"] = "Hunting Zone",
["color"] = 5,
["scale"] = 0.7,
["sprite"] = 141,
["radius"] = {
["show"] = true,
["color"] = 5,
["alpha"] = 80,
}
},
["animals"] = {
--[[
β οΈβ οΈβ οΈ
This is a table of animals that may appear in this area.
The rarity value of all animals must total 1.0f
The 'canAttack' value determines whether the animal can attack the player or not.
]]
{
["model"] = "a_c_deer",
["rarity"] = 0.20,
},
{
["model"] = "a_c_mtlion",
["rarity"] = 0.10,
["canAttack"] = math.random(1, 10) >= 7 -- 30% chance to attack the player
},
{
["model"] = "a_c_rabbit_01",
["rarity"] = 0.20,
},
{
["model"] = "a_c_boar",
["rarity"] = 0.50,
["canAttack"] = math.random(1, 10) >= 8 -- 20% chance to attack the player
}
},
},
{
["coords"] = vector3(-1508.0404, 4431.5532, 17.0580),
["radius"] = 40.0,
["maxAnimals"] = 15, -- Maximum number of animals that can be present in the zone at any given time
["removeAnimal"] = 0.5 * 60 * 1000, -- The deletion period for animals that have died but for which no action has been taken. If an animal dies and is not skinned, it will be deleted within this period.
["spawnInterval"] = 1 * 60 * 1000, -- A new animal will spawn every 1 minutes.
["blips"] = {
["show"] = true,
["label"] = "Hunting Zone",
["color"] = 5,
["scale"] = 0.7,
["sprite"] = 141,
["radius"] = {
["show"] = true,
["color"] = 5,
["alpha"] = 80,
}
},
["animals"] = {
--[[
β οΈβ οΈβ οΈ
This is a table of animals that may appear in this area.
The rarity value of all animals must total 1.0f
The 'canAttack' value determines whether the animal can attack the player or not.
In this area:
- Deer are somewhat common.
- Mountain lions are quite rare and have a chance to attack players.
- Rabbits are somewhat more common.
- Pigs are quite common.
- Boars are fairly common and have a chance to attack players.
]]
{
["model"] = "a_c_deer",
["rarity"] = 0.60,
},
{
["model"] = "a_c_mtlion",
["rarity"] = 0.05,
["canAttack"] = math.random(1, 10) >= 7 -- 30% chance to attack the player
},
{
["model"] = "a_c_rabbit_01",
["rarity"] = 0.05,
},
{
["model"] = "a_c_boar",
["rarity"] = 0.35,
["canAttack"] = math.random(1, 10) >= 8 -- 20% chance to attack the player
}
},
},
}
Config.Missions = {
--[[
β οΈβ οΈβ οΈ
Missions that players can undertake.
Each mission includes:
- label: The name of the mission.
- image: A URL to an image representing the mission.
- description: A brief description of the mission.
- location: The coordinates where the mission takes place.
- rewards: The rewards for completing the mission, including money and experience points (xp).
- animal: The type of animal to be hunted in the mission.
- requiredLevel: The minimum level required to undertake the mission.
- animalsToKill: The number of animals that need to be hunted to complete the mission.
β οΈβ οΈβ οΈ
]]
{
["label"] = "Deer Hunting", -- Name of the mission
["image"] = "https://user-images.githubusercontent.com/55892717/163342386-b07ff6ee-0316-4f18-a060-727fdc35afed.png", -- Image URL representing the mission
["description"] = "Hunt deer in the forest area.", -- Brief description of the mission
["rewards"] = { -- Rewards for completing the mission
["money"] = 150, -- Money reward
["xp"] = 150, -- Experience points reward
},
["animal"] = "a_c_deer", -- Type of animal to be hunted
["requiredLevel"] = 1, -- Minimum level required to undertake the mission
["animalsToKill"] = 5, -- Number of animals to hunt to complete the mission
},
{
["label"] = "Rabbit Hunting", -- Name of the mission
["image"] = "https://static.wikia.nocookie.net/gtawiki/images/8/89/Rabbit-GTAVe.png/revision/latest/scale-to-width-down/1200?cb=20240601214342", -- Image URL representing the mission
["description"] = "Hunt rabbits in the forest area.", -- Brief description of the mission
["rewards"] = { -- Rewards for completing the mission
["money"] = 300, -- Money reward
["xp"] = 250, -- Experience points reward
},
["animal"] = "a_c_rabbit_01", -- Type of animal to be hunted
["requiredLevel"] = 1, -- Minimum level required to undertake the mission
["animalsToKill"] = 5, -- Number of animals to hunt to complete the mission
},
{
["label"] = "Pig Hunting", -- Name of the mission
["image"] = "https://staticg.sportskeeda.com/editor/2025/04/22e45-17435384894625-1920.jpg", -- Image URL representing the mission
["description"] = "Hunt pigs in the forest area.", -- Brief description of the mission
["rewards"] = { -- Rewards for completing the mission
["money"] = 500, -- Money reward
["xp"] = 350, -- Experience points reward
},
["animal"] = "a_c_pig", -- Type of animal to be hunted
["requiredLevel"] = 1, -- Minimum level required to undertake the mission
["animalsToKill"] = 3, -- Number of animals to hunt to complete the mission
},
{
["label"] = "Boar Hunting I", -- Name of the mission
["image"] = "https://www.creocommunity.com/wp-content/uploads/2024/01/Trouver-des-sangliers-dans-GTA-Online-emplacements-de-chasse-1200x720.jpg", -- Image URL representing the mission
["description"] = "Hunt boars in the designated area.", -- Brief description of the mission
["rewards"] = { -- Rewards for completing the mission
["money"] = 600, -- Money reward
["xp"] = 450, -- Experience points reward
},
["animal"] = "a_c_boar", -- Type of animal to be hunted
["requiredLevel"] = 2, -- Minimum level required to undertake the mission
["animalsToKill"] = 8, -- Number of animals to hunt to complete the mission
},
{
["label"] = "Mountain Lion Hunting", -- Name of the mission
["image"] = "https://live.staticflickr.com/3770/19791705723_621cfe2bb0_b.jpg", -- Image URL representing the mission
["description"] = "Hunt mountain lions in the forest area.", -- Brief description of the mission
["rewards"] = { -- Rewards for completing the mission
["money"] = 1000, -- Money reward
["xp"] = 700, -- Experience points reward
},
["animal"] = "a_c_mtlion", -- Type of animal to be hunted
["requiredLevel"] = 2, -- Minimum level required to undertake the mission
["animalsToKill"] = 5, -- Number of animals to hunt to complete the mission
},
{
["label"] = "Deear Hunt I", -- Name of the mission
["image"] = "https://user-images.githubusercontent.com/55892717/163342386-b07ff6ee-0316-4f18-a060-727fdc35afed.png", -- Image URL representing the mission
["description"] = "Hunt various animals including deer and pigs.", -- Brief description of the mission
["rewards"] = { -- Rewards for completing the mission
["money"] = 1200, -- Money reward
["xp"] = 900, -- Experience points reward
},
["animal"] = "a_c_deer", -- Type of animal to be hunted
["requiredLevel"] = 3, -- Minimum level required to undertake the mission
["animalsToKill"] = 12, -- Number of animals to hunt to complete the mission
},
{
["label"] = "Boar Hunting II", -- Name of the mission
["image"] = "https://www.creocommunity.com/wp-content/uploads/2024/01/Trouver-des-sangliers-dans-GTA-Online-emplacements-de-chasse-1200x720.jpg", -- Image URL representing the mission
["description"] = "Advanced boar hunting mission for experienced hunters.", -- Brief description of the mission
["rewards"] = { -- Rewards for completing the mission
["money"] = 1500, -- Money reward
["xp"] = 1100, -- Experience points reward
},
["animal"] = "a_c_boar", -- Type of animal to be hunted
["requiredLevel"] = 4, -- Minimum level required to undertake the mission
["animalsToKill"] = 15, -- Number of animals to hunt to complete the mission
},
{
["label"] = "Predator Hunt I", -- Name of the mission
["image"] = "https://live.staticflickr.com/3770/19791705723_621cfe2bb0_b.jpg", -- Image URL representing the mission
["description"] = "Hunt dangerous mountain lions. Be careful!", -- Brief description of the mission
["rewards"] = { -- Rewards for completing the mission
["money"] = 2000, -- Money reward
["xp"] = 1400, -- Experience points reward
},
["animal"] = "a_c_mtlion", -- Type of animal to be hunted
["requiredLevel"] = 5, -- Minimum level required to undertake the mission
["animalsToKill"] = 8, -- Number of animals to hunt to complete the mission
},
{
["label"] = "Expert Deer Hunt", -- Name of the mission
["image"] = "https://user-images.githubusercontent.com/55892717/163342386-b07ff6ee-0316-4f18-a060-727fdc35afed.png", -- Image URL representing the mission
["description"] = "An expert-level deer hunting mission.", -- Brief description of the mission
["rewards"] = { -- Rewards for completing the mission
["money"] = 2500, -- Money reward
["xp"] = 1700, -- Experience points reward
},
["animal"] = "a_c_deer", -- Type of animal to be hunted
["requiredLevel"] = 6, -- Minimum level required to undertake the mission
["animalsToKill"] = 20, -- Number of animals to hunt to complete the mission
},
{
["label"] = "Pig Hunt II", -- Name of the mission
["image"] = "https://staticg.sportskeeda.com/editor/2025/04/22e45-17435384894625-1920.jpg", -- Image URL representing the mission
["description"] = "Hunt a variety of animals in different zones.", -- Brief description of the mission
["rewards"] = { -- Rewards for completing the mission
["money"] = 3000, -- Money reward
["xp"] = 2100, -- Experience points reward
},
["animal"] = "a_c_pig", -- Type of animal to be hunted
["requiredLevel"] = 7, -- Minimum level required to undertake the mission
["animalsToKill"] = 25, -- Number of animals to hunt to complete the mission
},
{
["label"] = "Predator Hunt II", -- Name of the mission
["image"] = "https://live.staticflickr.com/3770/19791705723_621cfe2bb0_b.jpg", -- Image URL representing the mission
["description"] = "Hunt multiple dangerous predators. Extreme caution required.", -- Brief description of the mission
["rewards"] = { -- Rewards for completing the mission
["money"] = 3500, -- Money reward
["xp"] = 2500, -- Experience points reward
},
["animal"] = "a_c_mtlion", -- Type of animal to be hunted
["requiredLevel"] = 8, -- Minimum level required to undertake the mission
["animalsToKill"] = 12, -- Number of animals to hunt to complete the mission
},
{
["label"] = "Master Hunter Challenge", -- Name of the mission
["image"] = "https://www.creocommunity.com/wp-content/uploads/2024/01/Trouver-des-sangliers-dans-GTA-Online-emplacements-de-chasse-1200x720.jpg", -- Image URL representing the mission
["description"] = "The ultimate hunting challenge for master hunters.", -- Brief description of the mission
["rewards"] = { -- Rewards for completing the mission
["money"] = 4500, -- Money reward
["xp"] = 3000, -- Experience points reward
},
["animal"] = "a_c_boar", -- Type of animal to be hunted
["requiredLevel"] = 9, -- Minimum level required to undertake the mission
["animalsToKill"] = 30, -- Number of animals to hunt to complete the mission
},
{
["label"] = "Legendary Hunt", -- Name of the mission
["image"] = "https://live.staticflickr.com/3770/19791705723_621cfe2bb0_b.jpg", -- Image URL representing the mission
["description"] = "Only the most skilled hunters can complete this legendary mission.", -- Brief description of the mission
["rewards"] = { -- Rewards for completing the mission
["money"] = 6000, -- Money reward
["xp"] = 4000, -- Experience points reward
},
["animal"] = "a_c_mtlion", -- Type of animal to be hunted
["requiredLevel"] = 10, -- Minimum level required to undertake the mission
["animalsToKill"] = 20, -- Number of animals to hunt to complete the mission
},
}
Config.Rewards = {
--[[
β οΈβ οΈβ οΈ
Rewards for each animal type.
The 'xp' value indicates the experience points awarded for hunting the animal.
The 'items' table lists the items and their amount that players receive upon successfully hunting the animal.
β οΈβ οΈβ οΈ
]]
[joaat("a_c_boar")] = {
["xp"] = 3,
["items"] = {
{ name = "boar_meat", amount = 1 },
{ name = "boar_skin", amount = 1 },
{ name = "boar_tusk", amount = 2 },
}
},
[joaat("a_c_pig")] = {
["xp"] = 2,
["items"] = {
{ name = "pig_meat", amount = 1 },
{ name = "pig_skin", amount = 1 },
{ name = "pig_feet", amount = 4 },
}
},
[joaat("a_c_rabbit_01")] = {
["xp"] = 1,
["items"] = {
{ name = "rabbit_meat", amount = 1 },
{ name = "rabbit_skin", amount = 1 },
{ name = "rabbit_feet", amount = 4 },
}
},
[joaat("a_c_mtlion")] = {
["xp"] = 30,
["items"] = {
{ name = "mtlion_meat", amount = 1 },
{ name = "mtlion_skin", amount = 1 },
}
},
[joaat("a_c_deer")] = {
["xp"] = 5,
["items"] = {
{ name = "deer_meat", amount = 1 },
{ name = "deer_skin", amount = 1 },
{ name = "deer_horns", amount = 2 },
}
},
}
Config.AnimalPartsPrices = {
--[[
β οΈβ οΈβ οΈ
Selling prices for each item obtained from hunting.
The key represents the item name, and the value represents the selling price.
β οΈβ οΈβ οΈ
]]
["boar_meat"] = 25,
["boar_skin"] = 40,
["boar_tusk"] = 15,
["pig_meat"] = 20,
["pig_skin"] = 35,
["pig_feet"] = 10,
["rabbit_meat"] = 10,
["rabbit_skin"] = 20,
["rabbit_feet"] = 5,
["mtlion_meat"] = 100,
["mtlion_skin"] = 150,
["deer_meat"] = 30,
["deer_skin"] = 50,
["deer_horns"] = 20,
}
Config.Levels = {
--[[
β οΈβ οΈβ οΈ
Experience points required for each level and the corresponding multiplier.
The multiplier increases the rewards players receive while hunting.
For example, at level 2 with a multiplier of 0.15, players will receive 15% more rewards.
β οΈβ οΈβ οΈ
]]
["default"] = {
--[[
Default level and experience points for new players.
]]
["xp"] = 0,
["level"] = 1,
},
["levels"] = {
--[[
Level progression table.
You can create a new level by copying and pasting.
]]
{ ["xp"] = 0, ["level"] = 1, ["multiplier"] = 0.05, },
{ ["xp"] = 1000, ["level"] = 2, ["multiplier"] = 0.15, },
{ ["xp"] = 3000, ["level"] = 3, ["multiplier"] = 0.17, },
{ ["xp"] = 6000, ["level"] = 4, ["multiplier"] = 0.20, },
{ ["xp"] = 10000, ["level"] = 5, ["multiplier"] = 0.15, },
{ ["xp"] = 15000, ["level"] = 6, ["multiplier"] = 0.27, },
{ ["xp"] = 21000, ["level"] = 7, ["multiplier"] = 0.30, },
{ ["xp"] = 28000, ["level"] = 8, ["multiplier"] = 0.35, },
{ ["xp"] = 36000, ["level"] = 9, ["multiplier"] = 0.37, },
{ ["xp"] = 45000, ["level"] = 10, ["multiplier"] = 0.40, },
}
}
Config.Commands = {
["exit"] = {
["command"] = "exitgroup", -- Command name to leave the hunting group.
["description"] = "Leave your current hunting group.", -- Command description.
["permission"] = nil -- group.admin or nil
},
["givexp"] = {
["command"] = "givehuntxp", -- Command name to give hunting experience points to a player.
["description"] = "Give hunting experience points to a player.", -- Command description.
["permission"] = "group.admin" -- group.admin or nil
},
["setxp"] = {
["command"] = "sethuntxp", -- Command name to set the hunting experience points of a player.
["description"] = "Set the hunting experience points of a player.", -- Command description.
["permission"] = "group.admin" -- group.admin or nil
},
["setlevel"] = {
["command"] = "sethuntlevel", -- Command name to set the hunting level of a player.
["description"] = "Set the hunting level of a player.", -- Command description.
["permission"] = "group.admin" -- group.admin or nil
},
}
Config.StepperWidget = {
--[[
These are the settings for the small widget that appears on the left side when the Job is started.
]]
["show"] = true, -- If you set it to `false`, progress for the task will not be visible and the system will not display what the user needs to do.
["keys"] = {
["label"] = "B", -- Represents the button character that will appear in the widget.
["key"] = "B", -- It is a key that can be enlarged or reduced by pressing it on the keyboard. https://docs.fivem.net/docs/game-references/controls/
}
}
Config.AnimalBlips = {
["enable"] = true, -- If you set it to `true`, the killed animal will have a blip on the map for easier location. If you set it to `false`, no blip will be shown.
["blips"] = {
--[[
Blip settings for killed animals.
You can find the blips and their colors at this address => https://docs.fivem.net/docs/game-references/blips
]]
["sprite"] = 141,
["color"] = 36,
["scale"] = 0.8,
["label"] = "Animal",
}
}
Config.Debug = function(...)
if Config.ShowDebug then
print(...)
end
end
Config.VehicleAction = function(vehicle, netId, plate, removed)
--[[
vehicle : Vehicle entity
plate : Vehicle plate
netId : Vehicle network id
removed : If the vehicle is being removed, set to true. Otherwise, set to false.
]]
if removed then
if GetResourceState("qs-vehiclekeys"):find("start") then
exports['qs-vehiclekeys']:RemoveKeys(plate, Config.Vehicle.model)
elseif GetResourceState("qb-vehiclekeys"):find("start") then
TriggerEvent('qb-vehiclekeys:client:RemoveKeys', plate)
end
return
end
if GetResourceState("qs-vehiclekeys"):find("start") then
exports['qs-vehiclekeys']:GiveKeys(plate, GetDisplayNameFromVehicleModel(Config.Vehicle.model, true))
else
TriggerEvent('vehiclekeys:client:SetOwner', plate)
end
if GetResourceState('LegacyFuel'):find("start") then
exports["LegacyFuel"]:SetFuel(vehicle, 100)
elseif GetResourceState('ox_fuel'):find("start") then
Entity(vehicle).state.fuel = 100
elseif GetResourceState('okokGasStation'):find("start") then
exports['okokGasStation']:SetFuel(vehicle, 100)
elseif GetResourceState("cdn-fuel"):find("start") then
exports["cdn-fuel"]:SetFuel(vehicle, 100)
end
end
Config.Notification = function(title, text, type, time)
title = title or "Hunting Job"
time = time or 5000
if GetResourceState("okokNotify"):find("start") then
exports['okokNotify']:Alert(title, text, time, type, true)
elseif lib ~= nil then
lib.notify({
title = title,
type = type,
duration = time,
description = text,
iconAnimation = "beatFade",
position = "center-right"
})
end
end
ConfigSv = {}
ConfigSv.Webhook = "" -- Your webhook link here
ConfigSv.Inventorys = {
-- [[ π’ Inventory detections, to work automatically compatible with some inventories. π’ ]]
["qb_inventory"] = GetResourceState("qb-inventory"):find("start") and true or false,
["qs_inventory"] = GetResourceState("qs-inventory"):find("start") and true or false,
["ox_inventory"] = GetResourceState("ox_inventory"):find("start") and true or false,
["export"] = nil
}
ConfigSv.MoneySettings = {
-- [[ π’ Money Settings π’ ]]
["hasMoneyItem"] = false,
["moneyItemName"] = "money",
}
function sendWebhook(source, name, logtype, amount)
local ts = os.time()
local time = os.date('%Y-%m-%d %H:%M:%S', ts)
local embed = {
{
["title"] = ('Player Earned %s'):format(logtype),
["description"] = ('The player made %s'):format(logtype),
["color"] = 16705372,
["fields"] = {
{["name"] = "π Player", ["value"] = ('**%s - [%s]**'):format(name, source)},
{["name"] = ("β Earned %s Value"):format(logtype), ["value"] = ('**$%s**'):format(amount)},
},
["author"] = {
["name"] = "Ayazwai",
["url"] = "https://github.com/ayazwai",
["icon_url"] = "https://cdn.discordapp.com/avatars/225154669817626626/12042ba04def3b74fdb3f6492853ee37.png?size=1024"
},
["timestamp"] = time,
["thumbnail"] = {
["url"] = "https://img.gta5-mods.com/q95/images/sauer-101-hunting-rifle-animated-4k/e80833-Sauer101_2.PNG"
}
}
}
PerformHttpRequest(ConfigSv.Webhook, function(err, text, headers) end, 'POST', json.encode({username = "Wais Hunting", embeds = embed}), { ['Content-Type'] = 'application/json' })
end
---------------------------------------------------------------------------------------------------------------
---This function is used to access player names.
---@enum [parent=#ConfigSv] GetPlayerName
---@param source
---@return #string
ConfigSv.GetPlayerName = function(source)
if Config.Framework.Framework == "esx" then
local Player = wFramework.Framework.GetPlayerFromId(source)
return ('%s - %s'):format(Player.get('firstName'), Player.get('lastName'))
elseif Config.Framework.Framework == "qbcore" or Config.Framework.Framework == "qbx" then
local Player = wFramework.Framework.Functions.GetPlayer(source)
return ('%s - %s'):format(Player.PlayerData.charinfo.firstname, Player.PlayerData.charinfo.lastname)
end
end
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---This function is used to access player names.
---@enum [parent=#ConfigSv] SetJob
---@param source
---@param job
---@return nil
ConfigSv.SetJob = function(source, job, grade)
local src = source
local Player = Config.Framework.Framework == "esx" and wFramework.Framework.GetPlayerFromId(src) or wFramework.Framework.Functions.GetPlayer(src)
if Config.Framework.Framework == "esx" then
Player.setJob(job, grade)
elseif Config.Framework.Framework == "qbcore" or Config.Framework.Framework == "qbx" then
Player.Functions.SetJob(job, grade)
end
end
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---Function that takes care of player money giving
---@enum [parent=#ConfigSv] AddMoney
---@param source
---@param amount
---@return #boolean
ConfigSv.AddMoney = function(src, amount)
if amount <= 0 then return false end
local p = promise:new()
if Config.Framework.Framework == "esx" then
local xPlayer = wFramework.Framework.GetPlayerFromId(src)
if ConfigSv.MoneySettings.hasMoneyItem then
xPlayer.addInventoryItem(ConfigSv.MoneySettings.moneyItemName, amount)
else
xPlayer.addMoney(amount)
end
elseif Config.Framework.Framework == "qbcore" or Config.Framework.Framework == "qbx" then
local Player = wFramework.Framework.Functions.GetPlayer(src)
if ConfigSv.MoneySettings.hasMoneyItem then
if ConfigSv.Inventorys.export:AddItem(src, ConfigSv.MoneySettings.moneyItemName, amount) == nil then
Player.Functions.AddItem(ConfigSv.MoneySettings.moneyItemName, amount)
end
else
Player.Functions.AddMoney("cash", amount)
end
end
sendWebhook(src, ConfigSv.GetPlayerName(src), "Money", amount)
p:resolve(true)
return Citizen.Await(p)
end
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---Function that takes care of player items giving
---@enum [parent=#ConfigSv] AddItem
---@param source
---@param item
---@param amount
---@return #boolean
ConfigSv.AddItem = function(src, item, amount)
local p = promise:new()
if Config.Framework.Framework == "esx" then
local xPlayer = wFramework.Framework.GetPlayerFromId(src)
xPlayer.addInventoryItem(item, amount)
elseif Config.Framework.Framework == "qbcore" or Config.Framework.Framework == "qbx" then
local Player = wFramework.Framework.Functions.GetPlayer(src)
if ConfigSv.Inventorys.export:AddItem(src, item, amount) == nil then
Player.Functions.AddItem(item, amount)
end
end
p:resolve(true)
return Citizen.Await(p)
end
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---Function getting the item count of the player
---@enum [parent=#ConfigSv] GetItem
---@param source
---@param item
---@param amount
---@return #boolean
ConfigSv.GetItemAmount = function(src, item)
local p = promise:new()
local count = nil
if ConfigSv.Inventorys.qs_inventory then
count = ConfigSv.Inventorys.export:GetItemTotalAmount(src, item)
elseif ConfigSv.Inventorys.ox_inventory or ConfigSv.Inventorys.qb_inventory then
count = ConfigSv.Inventorys.export:GetItemCount(src, item) or 0
else
local Player = Config.Framework.Framework == "esx" and wFramework.Framework.GetPlayerFromId(src) or wFramework.Framework.Functions.GetPlayer(src)
count = Config.Framework.Framework == "esx" and (xPlayer.getInventoryItem(item) ~= nil and xPlayer.getInventoryItem(item).count or 0) or (Player.Functions.GetItemByName(item) ~= nil and Player.Functions.GetItemByName(item).amount or 0)
end
p:resolve(count)
return Citizen.Await(p)
end
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---Function that takes care of player items removing
---@enum [parent=#ConfigSv] RemoveItem
---@param source
---@param item
---@param amount
---@return #boolean
ConfigSv.RemoveItem = function(src, item, amount)
local p = promise:new()
local Player = Config.Framework.Framework == "esx" and wFramework.Framework.GetPlayerFromId(src) or wFramework.Framework.Functions.GetPlayer(src)
if Config.Framework.Framework == "qbcore" or Config.Framework.Framework == "qbx" then
p:resolve(Player.Functions.RemoveItem(item, amount))
else
if ConfigSv.Inventorys.qs_inventory or ConfigSv.Inventorys.ox_inventory or ConfigSv.Inventorys.qb_inventory then
p:resolve(ConfigSv.Inventorys.export:RemoveItem(src, item, amount))
else
if Player.getInventoryItem(item).count >= amount then
Player.removeInventoryItem(item, amount)
p:resolve(true)
else
p:resolve(false)
end
end
end
return Citizen.Await(p)
end
---------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
---Function that takes care of player items removing
---@enum [parent=#ConfigSv] GetIdentifier
---@return #string
ConfigSv.GetPlayerIdentifier = function(src)
local p = promise:new()
local Player = Config.Framework.Framework == "esx" and wFramework.Framework.GetPlayerFromId(src) or wFramework.Framework.Functions.GetPlayer(src)
p:resolve(Config.Framework.Framework == "esx" and Player.getIdentifier() or Player.PlayerData.citizenid)
return Citizen.Await(p)
end
---------------------------------------------------------------------------------------------------------------
CreateThread(function()
ConfigSv.Inventorys.export = ConfigSv.Inventorys.qs_inventory and exports['qs-inventory'] or ConfigSv.Inventorys.ox_inventory and exports.ox_inventory or nil or ConfigSv.Inventorys.qb_inventory and exports['qb-inventory'] or nil
if not ConfigSv.Inventorys.export then
Config.Debug("[wais-hunting] No compatible inventory found, please set the export method manually in config_sv.lua")
end
end)