Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lib fork #13

Merged
merged 4 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# qbx-recyclejob
# qbx_recyclejob
Recycling Job For QBOX Project
42 changes: 18 additions & 24 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ local function registerEntranceTarget()
icon = 'fa-solid fa-house',
type = 'client',
event = 'qbx_recyclejob:client:target:enterLocation',
label = Lang:t("text.enter_warehouse"),
label = locale("text.enter_warehouse"),
distance = 1
},
},
Expand All @@ -60,7 +60,7 @@ local function registerEntranceTarget()
size = vec3(4.7, 1.7, 3.75),
debug = config.debugPoly,
onEnter = function()
lib.showTextUI(Lang:t("text.point_enter_warehouse"))
lib.showTextUI(locale("text.point_enter_warehouse"))
end,
onExit = function()
lib.hideTextUI()
Expand Down Expand Up @@ -90,7 +90,7 @@ local function registerExitTarget()
icon = 'fa-solid fa-house',
type = 'client',
event = 'qbx_recyclejob:client:target:exitLocation',
label = Lang:t("text.exit_warehouse"),
label = locale("text.exit_warehouse"),
distance = 1
},
},
Expand All @@ -102,7 +102,7 @@ local function registerExitTarget()
size = vec3(1.55, 4.95, 3.75),
debug = config.debugPoly,
onEnter = function()
lib.showTextUI(Lang:t("text.point_exit_warehouse"))
lib.showTextUI(locale("text.point_exit_warehouse"))
end,
onExit = function()
lib.hideTextUI()
Expand Down Expand Up @@ -133,10 +133,10 @@ end

local function getDutyTargetText()
if config.useTarget then
local text = onDuty and Lang:t("text.clock_out") or Lang:t("text.clock_in")
local text = onDuty and locale("text.clock_out") or locale("text.clock_in")
return text
else
local text = onDuty and Lang:t("text.point_clock_out") or Lang:t("text.point_clock_in")
local text = onDuty and locale("text.point_clock_out") or locale("text.point_clock_in")
return text
end
end
Expand Down Expand Up @@ -218,7 +218,7 @@ local function registerDeliveryTarget()
icon = 'fa-solid fa-house',
type = 'client',
event = 'qbx_recyclejob:client:target:dropPackage',
label = Lang:t("text.hand_in_package"),
label = locale("text.hand_in_package"),
distance = 1
},
},
Expand All @@ -230,7 +230,7 @@ local function registerDeliveryTarget()
size = vec3(0.95, 1.25, 2.5),
debug = config.debugPoly,
onEnter = function()
lib.showTextUI(Lang:t("text.point_hand_in_package"))
lib.showTextUI(locale("text.point_hand_in_package"))
end,
onExit = function()
lib.hideTextUI()
Expand Down Expand Up @@ -268,16 +268,10 @@ local function destroyInsideZones()
destroyDeliveryTarget()
end

local function loadAnimDict(dict)
while (not HasAnimDictLoaded(dict)) do
RequestAnimDict(dict)
Wait(5)
end
end

local function scrapAnim()
local time = 5
loadAnimDict('mp_car_bomb')

lib.requestAnimDict('mp_car_bomb')
TaskPlayAnim(cache.ped, 'mp_car_bomb', 'car_bomb_mechanic', 3.0, 3.0, -1, 16, 0, false, false, false)
local openingDoor = true

Expand Down Expand Up @@ -403,7 +397,7 @@ function RegisterPickupTarget(coords)
icon = 'fa-solid fa-house',
type = 'client',
event = 'qbx_recyclejob:client:target:pickupPackage',
label = Lang:t("text.get_package"),
label = locale("text.get_package"),
distance = 1
},
},
Expand All @@ -415,7 +409,7 @@ function RegisterPickupTarget(coords)
size = vec3(2.4, 2.45, 4.0),
debug = config.debugPoly,
onEnter = function()
lib.showTextUI(Lang:t("text.point_get_package"))
lib.showTextUI(locale("text.point_get_package"))
end,
onExit = function()
lib.hideTextUI()
Expand Down Expand Up @@ -455,10 +449,10 @@ RegisterNetEvent('qbx_recyclejob:client:target:toggleDuty', function()
onDuty = not onDuty

if onDuty then
exports.qbx_core:Notify(Lang:t("success.you_have_been_clocked_in"), 'success')
exports.qbx_core:Notify(locale("success.you_have_been_clocked_in"), 'success')
getRandomPackage()
else
exports.qbx_core:Notify(Lang:t("error.you_have_clocked_out"), 'error')
exports.qbx_core:Notify(locale("error.you_have_clocked_out"), 'error')
destroyPickupTarget()
end

Expand All @@ -479,7 +473,7 @@ RegisterNetEvent('qbx_recyclejob:client:target:pickupPackage', function()

if lib.progressBar({
duration = config.pickupActionDuration,
label = Lang:t("text.picking_up_the_package"),
label = locale("text.picking_up_the_package"),
useWhileDead = false,
canCancel = true,
disable = {
Expand All @@ -496,7 +490,7 @@ RegisterNetEvent('qbx_recyclejob:client:target:pickupPackage', function()
destroyPickupTarget()
registerDeliveryTarget()
else
exports.qbx_core:Notify(Lang:t('error.canceled'), 'error')
exports.qbx_core:Notify(locale('error.canceled'), 'error')
end
end)

Expand All @@ -511,7 +505,7 @@ RegisterNetEvent('qbx_recyclejob:client:target:dropPackage', function()

if lib.progressBar({
duration = config.deliveryActionDuration,
label = Lang:t("text.unpacking_the_package"),
label = locale("text.unpacking_the_package"),
useWhileDead = false,
canCancel = true,
disable = {
Expand All @@ -525,7 +519,7 @@ RegisterNetEvent('qbx_recyclejob:client:target:dropPackage', function()
TriggerServerEvent('qbx_recycle:server:getItem')
getRandomPackage()
else
exports.qbx_core:Notify(Lang:t('error.canceled'), 'error')
exports.qbx_core:Notify(locale('error.canceled'), 'error')
end
end)

Expand Down
11 changes: 6 additions & 5 deletions fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ description 'qbx_recyclejob'
repository 'https://github.com/Qbox-project/qbx_recyclejob'
version '2.1.0'

shared_script {
ox_lib 'locale'

shared_scripts {
'@ox_lib/init.lua',
'@qbx_core/shared/locale.lua',
'locales/en.lua',
'locales/*.lua',
'@qbx_core/modules/lib.lua',
}

server_scripts {
Expand All @@ -21,7 +21,8 @@ client_scripts {
}

files {
'config/client.lua',
'config/client.lua',
'locales/*.json',
}

lua54 'yes'
Expand Down
24 changes: 24 additions & 0 deletions locales/ar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"success": {
"you_have_been_clocked_in": "لقد تم تسجيل دخولك"
},
"text": {
"point_enter_warehouse": "[E] أدخل المستودع",
"enter_warehouse": "أدخل المستودع",
"exit_warehouse": "خروج من المستودع",
"point_exit_warehouse": "[E] مستودع الخروج",
"clock_out": "تسجيل خروج",
"point_clock_out": "[E] - تسجيل خروج",
"clock_in": "تسجيل دخول",
"point_clock_in": "[E] - تسجيل دخول",
"hand_in_package": "تسليم حزمة",
"point_hand_in_package": "[E] تسليم حزمة",
"get_package": "احصل على الحزمة",
"point_get_package": "[E] احصل على الحزمة",
"picking_up_the_package": "استلام الطرد",
"unpacking_the_package": "تفريغ حزمة"
},
"error": {
"you_have_clocked_out": "لقد تم تسجيل خروج"
}
}
32 changes: 0 additions & 32 deletions locales/ar.lua

This file was deleted.

22 changes: 22 additions & 0 deletions locales/cs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"success": {
"you_have_been_clocked_in": "Jste přihlášeni do práce"
},
"text": {
"point_enter_warehouse": "[E] Vstoupit do skladiště",
"enter_warehouse": "Vstoupit do skladiště",
"exit_warehouse": "Opustit skladiště",
"point_exit_warehouse": "[E] Opustit skladiště",
"clock_out": "[E] Odhlásit se",
"clock_in": "[E] Přihlásit se",
"hand_in_package": "Odevzdat balíček",
"point_hand_in_package": "[E] Odevzdat balíček",
"get_package": "Získat balíček",
"point_get_package": "[E] Získat balíček",
"picking_up_the_package": "Zvedání balíčku",
"unpacking_the_package": "Rozbalování balíčku"
},
"error": {
"you_have_clocked_out": "Jste odhlášeni"
}
}
37 changes: 0 additions & 37 deletions locales/cs.lua

This file was deleted.

25 changes: 25 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"success": {
"you_have_been_clocked_in": "You Have Been Clocked In"
},
"text": {
"point_enter_warehouse": "[E] - Enter Warehouse",
"enter_warehouse": "Enter Warehouse",
"exit_warehouse": "Exit Warehouse",
"point_exit_warehouse": "[E] - Exit Warehouse",
"clock_out": "Clock Out",
"point_clock_out": "[E] - Clock Out",
"clock_in": "Clock In",
"point_clock_in": "[E] - Clock In",
"hand_in_package": "Hand In Package",
"point_hand_in_package": "[E] - Hand In Package",
"get_package": "Get Package",
"point_get_package": "[E] - Get Package",
"picking_up_the_package": "Picking up the package",
"unpacking_the_package": "Unpacking the package"
},
"error": {
"you_have_clocked_out": "You Have Clocked Out"
}
}

29 changes: 0 additions & 29 deletions locales/en.lua

This file was deleted.

24 changes: 24 additions & 0 deletions locales/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"success": {
"you_have_been_clocked_in": "Has registrado la entrada"
},
"text": {
"point_enter_warehouse": "[E] Entrar al almacén",
"enter_warehouse": "Entrar al almacén",
"exit_warehouse": "Salir del almacén",
"point_exit_warehouse": "[E] Salir del almacén",
"clock_out": "Marcar la salida",
"point_clock_out": "[E] - Marcar la salida",
"clock_in": "Marcar la entrada",
"point_clock_in": "[E] - Marcar la entrada",
"hand_in_package": "Paquete de mano",
"point_hand_in_package": "[E] Paquete de mano",
"get_package": "Obtener paquete",
"point_get_package": "[E] Obtener paquete",
"picking_up_the_package": "Recogiendo el paquete",
"unpacking_the_package": "Desempacando"
},
"error": {
"you_have_clocked_out": "Has registrado la salida"
}
}
Loading
Loading