diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index d4f78c3e0..e896bd5c8 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -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 \ No newline at end of file +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 \ No newline at end of file diff --git a/server-data/resources/[esx_addons]/BOBsHunt/LICENSE b/server-data/resources/[esx_addons]/BOBsHunt/LICENSE index f288702d2..f47e2856b 100644 --- a/server-data/resources/[esx_addons]/BOBsHunt/LICENSE +++ b/server-data/resources/[esx_addons]/BOBsHunt/LICENSE @@ -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. - Copyright (C) + 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 @@ -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: - Copyright (C) + 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. diff --git a/server-data/resources/[esx_addons]/BOBsHunt/client/functions.lua b/server-data/resources/[esx_addons]/BOBsHunt/client/functions.lua index 15db50343..843ff044b 100644 --- a/server-data/resources/[esx_addons]/BOBsHunt/client/functions.lua +++ b/server-data/resources/[esx_addons]/BOBsHunt/client/functions.lua @@ -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 diff --git a/server-data/resources/[esx_addons]/BOBsHunt/client/main.lua b/server-data/resources/[esx_addons]/BOBsHunt/client/main.lua index a587f976c..b4dc8ab22 100644 --- a/server-data/resources/[esx_addons]/BOBsHunt/client/main.lua +++ b/server-data/resources/[esx_addons]/BOBsHunt/client/main.lua @@ -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 @@ -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 diff --git a/server-data/resources/[esx_addons]/BOBsHunt/fxmanifest.lua b/server-data/resources/[esx_addons]/BOBsHunt/fxmanifest.lua index 50ca81d12..94d894590 100644 --- a/server-data/resources/[esx_addons]/BOBsHunt/fxmanifest.lua +++ b/server-data/resources/[esx_addons]/BOBsHunt/fxmanifest.lua @@ -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 { diff --git a/server-data/resources/[esx_addons]/BOBsHunt/locales/en.lua b/server-data/resources/[esx_addons]/BOBsHunt/locales/en.lua index f725b5796..4e778b9a4 100644 --- a/server-data/resources/[esx_addons]/BOBsHunt/locales/en.lua +++ b/server-data/resources/[esx_addons]/BOBsHunt/locales/en.lua @@ -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' } \ No newline at end of file diff --git a/server-data/resources/[esx_addons]/BOBsHunt/locales/it.lua b/server-data/resources/[esx_addons]/BOBsHunt/locales/it.lua index 6767cb95d..502f631a7 100644 --- a/server-data/resources/[esx_addons]/BOBsHunt/locales/it.lua +++ b/server-data/resources/[esx_addons]/BOBsHunt/locales/it.lua @@ -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' } \ No newline at end of file diff --git a/server-data/resources/[esx_addons]/BOBsHunt/server/main.lua b/server-data/resources/[esx_addons]/BOBsHunt/server/main.lua index 614e3c211..f6f505168 100644 --- a/server-data/resources/[esx_addons]/BOBsHunt/server/main.lua +++ b/server-data/resources/[esx_addons]/BOBsHunt/server/main.lua @@ -1,4 +1,3 @@ -ESX = nil ESX = exports["es_extended"]:getSharedObject() RegisterServerEvent('esx_bobhunt:getPelt')