Skip to content

Commit

Permalink
feat(modules/weapons): add convar to disable weapon item notifications (
Browse files Browse the repository at this point in the history
  • Loading branch information
antond15 committed Mar 14, 2024
1 parent cf9c884 commit f74fe15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ else
giveplayerlist = GetConvarInt('inventory:giveplayerlist', 0) == 1,
weaponanims = GetConvarInt('inventory:weaponanims', 1) == 1,
itemnotify = GetConvarInt('inventory:itemnotify', 1) == 1,
weaponnotify = GetConvarInt('inventory:weaponnotify', 1) == 1,
imagepath = GetConvar('inventory:imagepath', 'nui://ox_inventory/web/images'),
dropprops = GetConvarInt('inventory:dropprops', 0) == 1,
dropmodel = joaat(GetConvar('inventory:dropmodel', 'prop_med_bag_01b')),
Expand Down
10 changes: 8 additions & 2 deletions modules/weapon/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ function Weapon.Equip(item, data, noWeaponAnim)
end

TriggerEvent('ox_inventory:currentWeapon', item)
Utils.ItemNotify({ item, 'ui_equipped' })

if client.weaponnotify then
Utils.ItemNotify({ item, 'ui_equipped' })
end

return item, sleep
end
Expand Down Expand Up @@ -123,7 +126,10 @@ function Weapon.Disarm(currentWeapon, noAnim)

::skipAnim::

Utils.ItemNotify({ currentWeapon, 'ui_holstered' })
if client.weaponnotify then
Utils.ItemNotify({ currentWeapon, 'ui_holstered' })
end

TriggerEvent('ox_inventory:currentWeapon')
end

Expand Down

0 comments on commit f74fe15

Please sign in to comment.