Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 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
67 changes: 67 additions & 0 deletions locales/ua
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
local Translations = {
afk = {
will_kick = "Ви AFK і будете кікнуті через ",
time_seconds = " секунд!",
time_minutes = " хвилину(и)!",
kick_message = "Вас було кікнуто за бездіяльність (AFK)"
},
wash = {
in_progress = "Авто миється...",
wash_vehicle = "[E] Помити авто",
wash_vehicle_target = "Помити авто",
dirty = "Авто не забруднене",
cancel = "Миття скасовано..."
},
consumables = {
eat_progress = "Їсте...",
drink_progress = "П'єте...",
liqour_progress = "Вживаєте алкоголь...",
coke_progress = "Швидке вдихання...",
crack_progress = "Курите крек...",
ecstasy_progress = "Ковтаєте пігулки...",
healing_progress = "Зцілення...",
meth_progress = "Курите жорсткий мет...",
joint_progress = "Підпалюєте косяк...",
use_parachute_progress = "Надягаєте парашут...",
pack_parachute_progress = "Пакуєте парашут...",
no_parachute = "У вас немає парашута!",
armor_full = "У вас вже достатньо броні!",
armor_empty = "На вас немає бронежилета...",
armor_progress = "Надягаєте бронежилет...",
heavy_armor_progress = "Надягаєте важкий бронежилет...",
remove_armor_progress = "Знімаєте бронежилет...",
canceled = "Скасовано..."
},
cruise = {
unavailable = "Круїз-контроль недоступний",
activated = "Круїз-контроль активовано",
deactivated = "Круїз-контроль вимкнено"
},
editor = {
started = "Запис розпочато!",
save = "Запис збережено!",
delete = "Запис видалено!",
editor = "До зустрічі, алігаторе!"
},
firework = {
place_progress = "Встановлення феєрверку...",
canceled = "Скасовано...",
time_left = "Запуск феєрверку через ~r~"
},
seatbelt = {
use_harness_progress = "Пристібання гоночного ременя",
remove_harness_progress = "Зняття гоночного ременя",
no_car = "Ви не в автомобілі."
},
teleport = {
teleport_default = "Скористатись ліфтом"
},
pushcar = {
stop_push = "[E] Зупинити штовхання"
}
}

Lang = Lang or Locale:new({
phrases = Translations,
warnOnMissing = true
})
Comment on lines +1 to +67
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this in a different PR, this is not what this PR aims to do (supposedly)?
And fix the issues with it ofcourse, as it currently lacks the .lua extension.

16 changes: 12 additions & 4 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,26 @@ RegisterNetEvent('equip:harness', function(item)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player then return end
if not Player.PlayerData.items[item.slot].info.uses then
Player.PlayerData.items[item.slot].info.uses = Config.HarnessUses - 1

local slot = item and item.slot
local itemData = slot and Player.PlayerData.items[slot]
local info = itemData and itemData.info
local uses = info and info.uses

if not uses then
-- if there was no uses at all, set the initial value
Player.PlayerData.items[slot].info.uses = Config.HarnessUses - 1
Player.Functions.SetInventory(Player.PlayerData.items)
elseif Player.PlayerData.items[item.slot].info.uses == 1 then
elseif uses == 1 then
exports['qb-inventory']:RemoveItem(src, 'harness', 1, false, 'equip:harness')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
exports['qb-inventory']:RemoveItem(src, 'harness', 1, false, 'equip:harness')
exports['qb-inventory']:RemoveItem(src, 'harness', 1, slot, 'equip:harness')

We need to define the slot here, so another harness with full usage doesnt get removed forexample.

TriggerClientEvent('qb-inventory:client:ItemBox', src, QBCore.Shared.Items['harness'], 'remove')
else
Player.PlayerData.items[item.slot].info.uses -= 1
Player.PlayerData.items[slot].info.uses -= 1
Player.Functions.SetInventory(Player.PlayerData.items)
end
end)


RegisterNetEvent('seatbelt:DoHarnessDamage', function(hp, data)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
Expand Down