Skip to content

Commit

Permalink
Merge pull request #553 from bitpredator/dev
Browse files Browse the repository at this point in the history
refactor: code cleaning, various corrections to the code as well as license updates
  • Loading branch information
bitpredator authored Nov 7, 2023
2 parents 3ca2dce + baf82e9 commit 509cace
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 26 deletions.
4 changes: 3 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@
10. [SQL]: chore: update database @bitpredator
11. [maps]: delete: remove maps verpi_driving_school @bitpredator
12. [ox_inventory]: chore: remove store dmvshool @bitpredator
13. [BasicItem]: chore: code cleanup and fixes @bitpredator
13. [BasicItem]: chore: code cleanup and fixes @bitpredator
14. [BOBHunt]: refactor: code cleaning, various corrections to the code as well as license updates @bitpredator
15. [BOBHunt]: refactor: supports all translations natively @bitpredator
4 changes: 2 additions & 2 deletions server-data/resources/[esx_addons]/BOBsHunt/LICENSE
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) <year> <name of author>
Copyright (C) 2023 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) <year> <name of author>
<program> Copyright (C) 2023 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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
drawText3D = function(x, y, z, text)
local onScreen, _x, _y = World3dToScreen2d(x,y,z)
local _, _, _ = table.unpack(GetGameplayCamCoords())
local _ = table.unpack(GetGameplayCamCoords())
local scale = 0.30

if onScreen then
Expand Down
21 changes: 6 additions & 15 deletions server-data/resources/[esx_addons]/BOBsHunt/client/main.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
ESX = nil
CreateThread(function()
while ESX == nil do
Wait(5)
ESX = exports["es_extended"]:getSharedObject()
end
if ESX.IsPlayerLoaded() then
ESX.PlayerData = ESX.GetPlayerData()
end
end)
ESX = exports["es_extended"]:getSharedObject()

local oPlayer = false
local playerpos = false
Expand Down Expand Up @@ -72,23 +63,23 @@ CreateThread(function()
ClearPedTasks(PlayerPedId())
if GetEntityModel(ped) == GetHashKey("a_c_boar") then
local item = 'boar_meat'
local p_name = 'boar meat'
local p_name = _U('boar_meat')
TriggerServerEvent('esx_bobhunt:getPelt', item, p_name)
elseif GetEntityModel(ped) == GetHashKey("a_c_mtlion") then
local item = 'pelt_mtnlion'
local p_name = 'Mountain Lion pelt'
local p_name = _U('pelt_mtnlion')
TriggerServerEvent('esx_bobhunt:getPelt', item, p_name)
elseif GetEntityModel(ped) == GetHashKey("a_c_deer") then
local item = 'deer_meat'
local p_name = 'deer meat'
local p_name = _U('deer_meat')
TriggerServerEvent('esx_bobhunt:getPelt', item, p_name)
elseif GetEntityModel(ped) == GetHashKey("a_c_coyote") then
local item = 'pelt_coyote'
local p_name = 'Coyote pelt'
local p_name = _U('pelt_coyote')
TriggerServerEvent('esx_bobhunt:getPelt', item, p_name)
elseif GetEntityModel(ped) == GetHashKey("a_c_rabbit_01") then
local item = 'rabbit_meat'
local p_name = 'Rabbit meat'
local p_name = _U('rabbit_meat')
TriggerServerEvent('esx_bobhunt:getPelt', item, p_name)
end

Expand Down
7 changes: 3 additions & 4 deletions server-data/resources/[esx_addons]/BOBsHunt/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ games { 'gta5' }

author 'Bob code reconstruction by: bitpredator'
description 'Bobs Hunting'
version '0.0.4'
version '1.0.0'

shared_script '@es_extended/imports.lua'

client_scripts {
'@es_extended/locale.lua',
'client/functions.lua',
'client/*.lua',
'locales/*.lua',
'config.lua',
'client/main.lua'
'config.lua'
}

server_scripts {
Expand Down
4 changes: 4 additions & 0 deletions server-data/resources/[esx_addons]/BOBsHunt/locales/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ Locales['en'] = {
['knife_uses'] = 'You need to use a knife',
['you_collected'] = 'You picked up a',
['deer_meat'] = 'Deer meat',
['boar_meat'] = 'Boar meat',
['pelt_mtnlion'] = 'Mountain Lion pelt',
['pelt_coyote'] = 'Pelt Coyote',
['rabbit_meat'] = 'Rabbit meat'
}
8 changes: 6 additions & 2 deletions server-data/resources/[esx_addons]/BOBsHunt/locales/it.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Locales['en'] = {
Locales['it'] = {
['knife_uses'] = 'Devi usare un coltello',
['you_collected'] = 'Hai raccolto un',
['deer_meat'] = 'Deer meat',
['deer_meat'] = 'Carne di cervo',
['boar_meat'] = 'Carne di cinghiale',
['pelt_mtnlion'] = 'Pelle di leone di montagna',
['pelt_coyote'] = 'Pelle di coyote',
['rabbit_meat'] = 'Carne di coniglio'
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ESX = nil
ESX = exports["es_extended"]:getSharedObject()

RegisterServerEvent('esx_bobhunt:getPelt')
Expand Down

0 comments on commit 509cace

Please sign in to comment.