-
Notifications
You must be signed in to change notification settings - Fork 340
fix harness #500
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
Open
DispersiaRoleplay
wants to merge
9
commits into
qbcore-framework:main
Choose a base branch
from
DispersiaRoleplay:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix harness #500
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
81267e8
Create ua.lua
DispersiaRoleplay fb69ca1
Merge pull request #2 from DispersiaRoleplay/DispersiaRoleplay-patch-2
DispersiaRoleplay 58cd28a
fixed error when use harness
DispersiaRoleplay 304fdee
Merge pull request #3 from DispersiaRoleplay/DispersiaRoleplay-patch-3
DispersiaRoleplay 44b11ab
Merge branch 'main' into main
DispersiaRoleplay e09d477
add incapacitated state check to handsup.lua
DispersiaRoleplay 12f8d68
Merge pull request #4 from DispersiaRoleplay/DispersiaRoleplay-patch-4
DispersiaRoleplay 99ca455
Add seatbelt alarm loop when unbuckled
DispersiaRoleplay a2a8db3
Merge pull request #5 from DispersiaRoleplay/DispersiaRoleplay-patch-5
DispersiaRoleplay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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') | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
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) | ||||||
|
|
||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
.luaextension.