Skip to content

Commit

Permalink
Merge pull request #701 from bitpredator/converting-BOBsHunt-to-bpt_h…
Browse files Browse the repository at this point in the history
…unting

Converting bobshunt to bpt_hunting
  • Loading branch information
bitpredator authored May 15, 2024
2 parents 4173166 + 6407ea3 commit 048d6e7
Show file tree
Hide file tree
Showing 14 changed files with 166 additions and 189 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ This program is a project for the fivem community, you have legal permission to

ATTENTION: You are not authorized to change the name of the resources present within it.

Database Installation: https://bitpredator.github.io/bptdevelopment/docs/database
Database Installation: https://bitpredator.github.io/bptdevelopment/docs/empiretown/database

Server installation procedure: https://bitpredator.github.io/bptdevelopment/docs/install-server
Server installation procedure: https://bitpredator.github.io/bptdevelopment/docs/empiretown/install-server

You are not authorized to sell this software (this is a free project).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 2023 bitpredator
Copyright (C) 2024 bitpredator

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

<program> Copyright (C) 2023 bitpredator
<program> Copyright (C) 2024 bitpredator
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
24 changes: 24 additions & 0 deletions server-data/resources/[bpt_addons]/bpt_hunting/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<h1 align='center'>bpt_hunting</a></h1>
<p align='center'><a href='https://discord.gg/ksGfNvDEfq'>Discord</a>

Copyright (C) 2024 bitpredator

This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.

This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details.

ATTENTION:
You are not authorized to change the name of the resource and the resources within it.

If you want to contribute you can open a pull request.

You are not authorized to sell this software (this is free project).

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

# Dependancy:
rprogress

https://forum.cfx.re/t/release-standalone-rprogress-customisable-radial-progress-bars/1630655
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
INSERT INTO 'items' ('name', 'label', 'weight', 'rare', 'can_remove') VALUES
('pelt_boar', 'Boar Pelt', 1, 0, 1),
('pelt_mtnlion', 'Mountain Lion Pelt', 1, 0, 1),
('pelt_deer', 'Deer Pelt', 1, 0, 1),
Expand Down
134 changes: 134 additions & 0 deletions server-data/resources/[bpt_addons]/bpt_hunting/client/main.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
ESX = exports["es_extended"]:getSharedObject()

local oPlayer, playerpos = false, false

CreateThread(function()
while true do
oPlayer = PlayerPedId()
playerpos = GetEntityCoords(oPlayer)
Wait(500)
end
end)

CreateThread(function()
while true do
Wait(1)
local handle, ped = FindFirstPed()
local success
repeat
success, ped = FindNextPed(handle)
local pos = GetEntityCoords(ped)
local distance = GetDistanceBetweenCoords(pos.x, pos.y, pos.z, playerpos.x, playerpos.y, playerpos.z, true)
if distance < 2 and CanSlaughterPed(ped) then
drawText3D(pos.x, pos.y, pos.z + 0.6, "[H] ~b~Skin Animal ~s~")
while IsControlPressed(0, 30) do
break
end
if IsControlJustPressed(1, 74) then
if GetSelectedPedWeapon(PlayerPedId()) == GetHashKey("WEAPON_KNIFE") then
local oldped = ped
SetEntityHeading(ped, GetHeadingFromVector_2d(pos.x - playerpos.x - playerpos.y) + 180)
SetEntityHeading(oPlayer, GetHeadingFromVector_2d(pos.x - playerpos.x, pos.y - playerpos.y))

exports.rprogress:Custom({
Async = true,
x = 0.5,
y = 0.5,
From = 0,
To = 100,
Duration = 5000,
Radius = 60,
Stroke = 10,
MaxAngle = 360,
Rotation = 0,
Easing = "easeLinear",
Label = "SKINNING",
LabelPosition = "right",
Color = "rgba(255, 255, 255, 1.0)",
BGColor = "rgba(107, 109, 110, 0.95)",
Animation = {
animationDictionary = "anim@heists@narcotics@funding@gang_idle",
animationName = "gang_chatting_idle01",
},
DisableControls = {
Mouse = false,
Player = true,
Vehicle = true,
},
})
Wait(5000)
ClearPedTasks(PlayerPedId())
if GetEntityModel(ped) == GetHashKey("a_c_boar") then
local item = "boar_meat"
local p_name = TranslateCap("boar_meat")
TriggerServerEvent("bpt_hunting:getPelt", item, p_name)
elseif GetEntityModel(ped) == GetHashKey("a_c_mtlion") then
local item = "pelt_mtnlion"
local p_name = TranslateCap("pelt_mtnlion")
TriggerServerEvent("bpt_hunting:getPelt", item, p_name)
elseif GetEntityModel(ped) == GetHashKey("a_c_deer") then
local item = "deer_meat"
local p_name = TranslateCap("deer_meat")
TriggerServerEvent("bpt_hunting:getPelt", item, p_name)
elseif GetEntityModel(ped) == GetHashKey("a_c_coyote") then
local item = "pelt_coyote"
local p_name = TranslateCap("pelt_coyote")
TriggerServerEvent("bpt_hunting:getPelt", item, p_name)
elseif GetEntityModel(ped) == GetHashKey("a_c_rabbit_01") then
local item = "rabbit_meat"
local p_name = TranslateCap("rabbit_meat")
TriggerServerEvent("bpt_hunting:getPelt", item, p_name)
end
Wait(10)
SetPedAsNoLongerNeeded(oldped)
if DoesEntityExist(ped) then
DeleteEntity(ped)
end
Wait(1000)
break
else
ESX.ShowNotification(TranslateCap("knife_uses"))
end
end
end
until not success
EndFindPed(handle)
end
end)

local oldped = {}
function CanSlaughterPed(ped)
if
not IsPedAPlayer(ped)
and not IsPedInAnyVehicle(ped, false)
and not IsPedHuman(ped)
and IsEntityDead(ped)
and ped ~= oldped
and GetEntityModel(ped) == GetHashKey("a_c_boar")
or GetEntityModel(ped) == GetHashKey("a_c_coyote")
or GetEntityModel(ped) == GetHashKey("a_c_deer")
or GetEntityModel(ped) == GetHashKey("a_c_mtlion")
or GetEntityModel(ped) == GetHashKey("a_c_rabbit_01")
then
return true
end
return false
end

local blips = {
{ title = "Hunters Den", colour = 4, id = 463, x = -1132.93, y = 4948.42, z = 221.87 },
}

CreateThread(function()
for _, info in pairs(blips) do
info.blip = AddBlipForCoord(info.x, info.y, info.z)
SetBlipSprite(info.blip, info.id)
SetBlipDisplay(info.blip, 4)
SetBlipScale(info.blip, 0.8)
SetBlipColour(info.blip, info.colour)
SetBlipAsShortRange(info.blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(info.title)
EndTextCommandSetBlipName(info.blip)
end
end)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fx_version("adamant")
games({ "gta5" })

author("Bob code reconstruction by: bitpredator")
description("Bobs Hunting")
author("bitpredator")
description("bpt_hunting")
version("1.0.0")

shared_script("@es_extended/imports.lua")
Expand All @@ -18,5 +18,5 @@ server_scripts({
"@es_extended/locale.lua",
"locales/*.lua",
"config.lua",
"server/main.lua",
"server/*.lua",
})
28 changes: 0 additions & 28 deletions server-data/resources/[esx_addons]/BOBsHunt/README.md

This file was deleted.

138 changes: 0 additions & 138 deletions server-data/resources/[esx_addons]/BOBsHunt/client/main.lua

This file was deleted.

6 changes: 0 additions & 6 deletions server-data/resources/[esx_addons]/BOBsHunt/items.sql

This file was deleted.

Loading

0 comments on commit 048d6e7

Please sign in to comment.